Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is JSONP obsolete? [closed]

Tags:

json

jsonp

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?)

like image 447
ChrisW Avatar asked Sep 14 '13 11:09

ChrisW


1 Answers

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.

like image 170
Denys Séguret Avatar answered Oct 20 '22 05:10

Denys Séguret