开发者

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.

  1. Since both websites are owned by me, is there anyway to overcome the "same origin policy" ?

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜