I\'m creating an iOS / Droid app using AJAX, jQuery, and Phonegap. The backend is a Drupal 7 site serving content via web services. I\'m a little confused about the necessity fo
JSONP was desinged in response to the Same-Origin Policy (SOP) which stated that if the HTML page was served from one domain, then the web page (once delivered to a client) could not make an "Ajax call" to a site on a different domain. If the "Ajax call" was made to the same domain, all is fine. (Perhaps that it was you are seeing?)
Now, you can't make Ajax calls to different domains but you can use the script tag to invoke code on a different domain (go figure, eh?). Now the thing is, suppose you made a call to a different domain in your script tag and you got back some JSON text. How would you do anything with it? This is where JSONP comes in. If the server sends back some JSON wrapped in a function call, then when you evaulate that (wrapped) object, you are now "doing something with it."
Lately though, most browsers support CORS, so JSONP is not needed. Some older browsers do not support CORS, however, but these are getting to be fewer and fewer.