开发者

Expose JSON as queryable for jQuery

开发者 https://www.devze.com 2022-12-29 22:49 出处:网络
I am trying to expose some data, user names, as json format on my server. I want to use jQuery.getJSOn开发者_如何学编程() method to query data. I can get my data converted to json with newtonsoft.dll

I am trying to expose some data, user names, as json format on my server. I want to use jQuery.getJSOn开发者_如何学编程() method to query data. I can get my data converted to json with newtonsoft.dll on server and save it in a file. But as far as I know it is not queryable. I want something like

http://search.twitter.com/search.json?callback=?&q=abc

Can anyone help me out to expose my data ion the above format.


if you want to serve static JSON files your .dll produces, just put them in a folder on your web server.

Or code a web service that spits out JSON

if you put the files in a folder called json on example.com, and you calling getJSON from the same server, you should be good.

If you are asking how to generate web services, you need better tagging on this site.

::ADDITIONAL RESPONSE::


jQuery.getJSON('datanew.json',function (data) {
    var obj,i,dataLen,maxLen;
    maxLen = 5;
    i = 0;
    dataLen = data.length;
    do {
        if ( data[i].Name !== undefined ) {
            alert ( data[i].Name ); 
        }
        i = i + 1;
    } while ( i < dataLen && i < maxLen );
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号