IE https CORS XHR request fails with Script7002: XMLHttpRequest: Network Error 0x2eff(IE https CORS XHR 请求因 Script7002 失败:XMLHttpRequest:网络错误 0x2eff)
问题描述
在所有其他非 IE 浏览器中,以下代码片段效果很好:
In all other non-IE browsers, the following code snippet works great:
<!DOCTYPE html>
<html>
<script type="text/javascript">
var xhr = new XMLHttpRequest();
var url = "https://otherdomain.com";
var method = "GET";
xhr.open(method, url, true);
xhr.onload = function() {
var responseText = xhr.responseText;
document.write(responseText);
};
xhr.send()
</script>
</html>
在两个不同的 IE11 浏览器(在不同的操作系统版本上运行),我得到两个不同的错误:
In two different IE11 browsers (running on different OS versions), I get two different errors:
- IE11 Win7:Script7002:XMLHttpRequest:网络错误 0x80070005,访问被拒绝.
- IE11 Win8: Script7002: XMLHttpRequest: Network Error 0x2eff 由于错误 00002eff 无法完成操作
Google 搜索上述错误代码并没有找到任何有用的信息.我尝试设置 Content-Type,为 onprogress 和 onload 添加虚拟函数,但无济于事.
Google searches for the above error codes don't turn up anything useful. I've tried setting Content-Type, adding dummy functions for onprogress and onload, to no avail.
推荐答案
想通了.
在我们的案例中,在之前的项目中,我们更改了 IE 允许我们使用的 SSL 协议.Ajax 请求失败,因为不允许 IE 根据自定义配置协商 SSL 握手.
In our case, on a previous project we had changed which SSL protocols were allowed by IE to us. Ajax requests were failing because IE was not allowed to negotiate the SSL handshakes based on the custom configuration.
解决方案是打开 Internet 选项,选择高级"选项卡,然后单击恢复高级设置"按钮.之后,Ajax 请求运行良好.
希望这可以节省我花在这上面的 6 个小时左右的时间!
Hopefully this saves someone else the 6 hours or so I spent on this!
这篇关于IE https CORS XHR 请求因 Script7002 失败:XMLHttpRequest:网络错误 0x2eff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IE https CORS XHR 请求因 Script7002 失败:XMLHttpRequest:网络错误 0x2eff


基础教程推荐
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01