I'm having ain issue getting JSONP to work.
I'm using the basic example:
alert('check 1');
var myJSONP = new Request.JSONP({
url: 'http://www.flickr.com/services/feeds/photos_public.gne?format=json',
callbackKey: 'jsoncallback',
data: {
partTag: 'mtvo',
iod: 'hlPrice',
viewType: 'json',
results: '100',
query: 'ipod'
},
onRequest: function(url){
// a script tag is created with a src attribute equal to url
},
onComplete: function(data){
// the request was completed.
alert('Done!')
}
}).send();
alert('check 2');
But i never get an alert('Done') executed.
You can check it on codepen as well: http://codepen.io/r0b0tn1k/pen/VYZqeq
Any ideas why it's not working?
Request.JSONP is not part of the Core library, you can find it in More.
What you actually need is just to add this:
Works good after that. http://codepen.io/sergiocrisostomo/pen/JoPwvw