A standalone lightweight JSONP JavaScript library
JavaScript PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
README
jsonp.js

README

Lightweight JSONP Javascript Library without dependencies.

Usage:

/* Optional setting for default callback name */
JSONP.init({
  callbackName: 'jsonp'
});


/* 
* This will make a request for the url 
* /test?otherParam1&param1=a&param2=b&callback=json{N}  where {N} is an auto incrementing counter
* and then callback your function with the response.
* Fourth parameter is if you want to override the "callback" named parameter. 
*/
JSONP.get('/test?otherParam=1', {param1:'a', param2:'b'}, function(response){
	console.log(response);
}/* , "overrideCallbackName" */);