Expose JSON as request for jQuery
I am trying to expose some data, usernames as json format on my server. I want to use a method jQuery.getJSOn()
to query data. I can convert my data to json using newtonsoft.dll to the server and save it to a file. But as far as I know, this is not a question. I want something like
http://search.twitter.com/search.json?callback=?&q=abc
Can anyone help me expose my data in the above format.
a source to share
if you want to serve the static JSON files your .dll produces, just put them in a folder on your web server.
Or web service code that spits out JSON
if you put files in json folder on example.com and you call getJSON from the same server you should be good.
If you are asking how to create web services, you need to better tag the site.
:: ADDITIONAL ANSWER:
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 );
});
a source to share