Is this something restricted by cross-origin policy or not?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can't. You could only sent requests to www.foo.com
.
回答2:
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
.