I am trying to create a timer that ever x minutes it will call to a server, get a JSON file and do something with it. The merits of that system are not in question right now, the question involves getting the JSON file. Currently I am using kimonify from KimonoLabs to create a JSON file from some other site. They suggest I use
function kimonoCallback(data) {
// do something with the data
// please make sure the scope of this function is global
}
$.ajax({
"url":"http://www.kimonolabs.com/api/9ey3ljcs?apikey=d753b0c5546495826e7aaa5422f59e30&callback=kimonoCallback",
"crossDomain":true,
"dataType":"jsonp"
});
At the same time I was pursuing other methods and was getting a parse error, and I found this solution. So far both used &callback=
what is so special about &callback=
that makes it more preferable to something like .done()
or success:
I am guessing it has something to deal with Access-Control-Allow-Origin.