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

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

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

2条回答
  •  醉酒成梦
    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.

提交回复
热议问题