consume .net web service using jquery

后端 未结 4 1462
猫巷女王i
猫巷女王i 2021-01-03 13:34

I made this web service that returns a datatable from sql server db. Can someone help me with the jquery to display it?

web service

[WebService(Name         


        
4条回答
  •  我在风中等你
    2021-01-03 14:14

    You have multiple options

    1) You can either return pure html from the back end and do .html on the div tag

    2) Construct a jsonp object using stringbuild and return to the UI. In the UI you can use eval(response) and parse the object.

    Let me know if you need any furthur info on this.

    I have done both the approaches.

    this is form my code , and you can do as below

    var jsonobj = eval('(' + tempstr + ')');
    
                for (var i = 0; i < jsonobj.searchsuggest.items.item.length; i++) { }
    

提交回复
热议问题