In jQuery,
$.ajax({
url: 'http://reddit.com/r/aww.json',
dataType: 'jsonp',
jsonp: 'jsonp'
});
sends a request to the following URL:
http://www.reddit.com/r/aww.json?jsonp=jsonp1354967449950
.
But in Zepto, the same function call sends a request to:
http://www.reddit.com/r/aww.json?callback=jsonp4
The Reddit API requires the JSONP callback to be named 'jsonp'. Looking through the Zepto source, I get the feeling the 'jsonp' option is not supported.
How can I emulate this jQuery behaviour in Zepto?
Note: I'm trying to get this behaviour in Backbone.js by overriding a collection's sync function and calling collection.fetch(), similar to this code: https://gist.github.com/1245613. I'm curious if there's a more idiomatic way of doing this.
In Zepto:
$.ajax({
url: 'http://reddit.com/r/aww.json?jsonp=?'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With