我救了一个页面在硬盘上,然后我打开了它,并想从已保存的HTML文件连接到互联网上的服务器的网站。当试图做使用 XMLHtt prequest
从装载在浏览器中手动将文件中的HTTP请求,它基本上做不到。能否请你告诉我,我应该怎么办?或者,这可能吗?
I saved a page on a hard drive then I opened it and wanted to connect from a saved html file to the server website on the Internet. When trying to do a HTTP request using XMLHttpRequest
from a file that were loaded in browser manually, it basically fails to do. could you please tell me what should i do? Or is it possible?
除非是跨域xmlHtt prequest,它会由于同源策略的失败。
Unless it is a cross domain xmlHttpRequest, it will fail due to same-origin policy.