With various methods to get around the same-origin policy, such as CORS (if you have access to the server hosting the files), or by using parsing methods such as the getJSON
method in jQuery, does JSONP ever now need to be used?
(I actually struggled for a long time to get my head round JSONP anyway - I don't think it helped that some sites seemed to overlook it - for example, the Google Map developer docs state that they return data as JSON, but make no mention of the Same Origin Policy - is this naïve of them for assuming most people know of the issues and can get round of it, or naïve of me for getting too bogged down with trying to understand the technical differences between JSON and JSONP?)
Yes, JSONP is obsolete now. There's absolutely no reason to offer a JSONP service anymore. Ajax with the relevant CORS headers is saner and cleaner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With