Why is cross-domain JSONP safe, but cross-domainJSON not?
问题 I'm having trouble connecting some dots having recently learned of JSONP. Here's my understanding: Cross-domain XmlHttpRequests for any content (including JSON) is banned, due to the same origin policy. This protects against XSRF. You are permitted to have a script tag with a src that returns JSONP - some JSON padded inside a call to a Javascript function (say 'Foo') You can have some implementation of 'foo' on the page that will get called when the JSONP data is returned, and you can do