Does anyone know how can I use .jsonp jquery to retrieve data from a URL? I have written the following code, but it doesn’t seem to be working for me:
$.JSONP({
url: 'http://test.com',
callbackKey: 'jsoncallback',
onComplete: function (data) {
alert(data)
// the request was completed.
}
});
NOTE: the url working fine
What is
$.JSONP? The simplest way to do this is as followsHere is an example.
Update: Since you asked in the comment – How can I apply it into for loop instead ?
Example Here using for loop.