XMLHtt prequest从硬盘上保存的网页硬盘、网页、XMLHtt、prequest

2023-09-10 14:58:42 作者:赐我梦境

我救了一个页面在硬盘上,然后我打开了它,并想从已保存的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.