I am trying to use the getJSON function in jQuery to import some data and trigger a callback function. The callback function doesn\'t run. However, if I try the same thing w
$.getJSON() is JSONP, so change it this way:
$("#test2").click(function() {
$.getJSON("index.html?callback=?",
function(response) {
alert('hi');
}
)
});
Server receives param callback filled with something like: jsonp1291077863309. In a response write back callback function jsonp1291077863309( PUT_JSON_HERE).