On page 'www.foo.com', can a script loaded from 'www.example.com' send ajax requests to 'www.example.com'?

前端 未结 2 576
臣服心动
臣服心动 2021-01-05 22:38

Is this something restricted by cross-origin policy or not?

相关标签:
2条回答
  • 2021-01-05 23:19

    You can't. You could only sent requests to www.foo.com.

    0 讨论(0)
  • 2021-01-05 23:36

    No. The page is the origin, not the script.

    The page is on www.foo.com. The script is loaded from www.example.com. XHR requests can be made to www.foo.com but not www.example.com.

    0 讨论(0)
提交回复
热议问题