0
4

2 に答える 2

2

The origin is determined by:

  • protocol
  • port
  • hostname

All three have to be the same.

The server the page is on is not relevant (beyond it being rare that two URLs on two different servers will share the same hostname).

Note that example.com and www.example.com are different hostnames.

于 2013-02-11T17:50:34.630 に答える
0

The fact that the two pages are on the same server does not matter, it has to be on the same domain.

To bypass this limitation you have to set the header "Access-Control-Allow-Origin" in your response from the server with the value "*"(be careful, it allows all) or a specific domain name "http://myDomain.com".

I hope this helps.

于 2013-02-11T17:28:14.850 に答える