title |
---|
getJSONP |
Request remote JSONP data
- scriptSource - a string of the name of the script to be loaded
- callback=jsonp ( or similar ) - params are required to use with any JSONP service
- callback - a function to be run when the script has been loaded
{% highlight js linenos %} Popcorn.xhr({
url: "jsonp.json?callback=jsonp",
dataType: "jsonp",
success: function( data ) {
/*
`data` will be the parsed json object
*/
}
});
{% endhighlight %}
{% highlight js linenos %} Popcorn.getJSONP(
"jsonp.json?callback=jsonp",
function( data ) {
/*
`data` will be the parsed json object
*/
}
);
{% endhighlight %}
{% highlight js linenos %} Popcorn.xhr({
url: "http://domain.com/service/?callback=jsonp",
dataType: "jsonp",
success: function( data ) {
/*
`data` will be the parsed json object
*/
}
});
{% endhighlight %}
{% highlight js linenos %} Popcorn.getJSONP(
"http://domain.com/service/?callback=jsonp",
function( data ) {
/*
`data` will be the parsed json object
*/
}
);
{% endhighlight %}