JAVASCRIPT
Cross Browser JsonP requests
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Executes a JSONP request
Method name | Description |
---|---|
new JsonP(uri, options) | Constructor |
.abort() | Abort the request, avoiding onSuccess or onFailure being called. |
uri
Request URLoptions
Request optionsoptions.onSuccess
Success callback. Called with the JSONP response.options.onFailure
Failure callback. Called when there is a timeout.options.failureObj
Object to be passed as argument to failure callbackoptions.timeout
Timeout for the request, in seconds. defaults to 10.options.params
Object with URL parameters.options.callbackParam
URL parameter which gets the name of the JSONP function to call. defaults to 'jsoncallback'.options.randVar
(Advanced, not recommended unless you know what you're doing) A string to append to the callback name. By default, generate a random number. Use an empty string if you already passed the correct name in the internalCallback option.options.internalCallback
(Advanced) Name of the callback function stored in the Ink.Net.JsonP object (before it's prefixed).Make a request to SAPO Photos
and print the images
Code
Abort the request, avoiding onSuccess or onFailure being called.