Enables cross-domain requests to any JSON API.
Very useful for mashup sites - since API calls can be done client-side, no server code is needed. Note that exposing API secret keys in client code is discouraged. The site is also available for secure domains using https://jsonp.nodejitsu.com as the origin. Examples in jQuery, though it is not required.
(not supported by IE < 10)
Wrapper function of jQuery.ajax(), which detects browser support and picks the best available transport:
In addition to the options available for jQuery.ajax(), the plugin adds two additional options: corsSupport and jsonpSupport.
Tested against jQuery 1.8.2, though it should be compatible with jQuery 1.5+.
Unfortunately, detection of response errors with JSONP is difficult, at best. jQuery's JSONP implementation won't call an error callback unless an explicit timeout is specified (which the plugin takes care of) - see here for more info and options.
CORS, however, is just normal AJAX! There is also a security advantage, in that it's not possible for a malicious service (including this one) to run arbirtrary JavaScript on your page.