Wednesday, 21 August 2013

jQuery JSONP not working anymore?

jQuery JSONP not working anymore?

I have been trying to load a JSON file from a cross-domain server. I've
tried examples from stackoverflow and from the jQuery docs. I did get it
working in a previous project, but now it strangely does not. The error
returned from jQuery is unreadable to me. What can possibly go wrong here?
$(document).ready(function() {
console.log("Start loading");
$.ajax({
type: 'GET',
url: "http://www.nightoferror.nl/data/test.js",
dataType: 'jsonp',
crossDomain: true,
error: function(data) {
console.log('error', data);
},
success: function(data) {
console.log('success', data);
}
});
});
And the erratic JSFiddle here: http://jsfiddle.net/ZuyJV/1/

No comments:

Post a Comment