|
|
|
|
|
by alptrv
4770 days ago
|
|
Basically JSONP is used by API providers, so that theirs API might be called by JavaScript running in browser. Until CORS[1] got supported by current browsers, JSONP was used to get some JSON from an API located on different domain (well it of course can be used today for browsers that don't support CORS)
The code snipped you linked just wraps standard JSON response making it an executable script that when included on the page calls the supplied callback's name passing the JSON. 1. http://www.w3.org/TR/cors/ |
|