I have 2 websites (on different domains) that need to "talk" to each other. What solutions are there beside JSONP?
I have 2 websit开发者_开发百科es (on different domains) that need to "talk" to each other. Basically 1 website would be providing data and the other website would be reading data.
Since both websites are owned by me, is there anyway to overcome the "same origin policy" ?
If not, other than JSONP what other solutions do I have ?
First: yes, look below
header("Access-Control-Allow-Origin: *");
Second: you can, look above
I do not believe there is a way to override the same-origin policy as it comes from the user's JavaScript console built in to the browser. However, you could post to a PHP cURL script.
You can always make the cross site calls on the backend. i.e. setup a soap service on one and consume the soap service on the other domain.
精彩评论