IE 10& 11 CORS状态0 [英] IE 10 & 11 CORS Status 0
本文介绍了IE 10& 11 CORS状态0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个IE错误,我似乎无法弄清楚。我只支持IE 10和11,所以我认为我可以使用以下代码。
I have an IE bug I can't seem to figure out. I am supporting IE 10 and 11 only so I thought I could get away with the following code.
我有一个AJAX请求:
I have an AJAX request:
$.ajax({
type: {method},
url: {url},
cache: false,
crossDomain: true,
data: {data to send},
success: function (data, textStatus, xhr) {
///success code
},
error: function (xhr, textStatus, errorThrown) {
//error code
}
});
此代码在Firefox和Chrome中运行良好。它在IE 10,11中不起作用。我的印象是在IE 10,11中修复了CORS没有?
This code works great in Firefox and Chrome. It doesn't work in IE 10,11. I was under the impression that CORS was fixed in IE 10,11 no?
为什么我在IE 10,11中得到跟随错误?
Why do I get the follow error in IE 10,11?
{"readyState":0,"status":0,"statusText":"Error: Access is denied.\r\n"}
推荐答案
所以我需要启用'跨域访问数据源'。
So I needed to enable 'Access data sources across domains'.
步骤:
- 选择互联网选项
- 选择安全选项卡
- 选择自定义级别...
- 向下滚动到其他
- 跨域查找访问数据源
- 将值更改为启用
- Select Internet Options
- Select the Security Tab
- Select Custom level...
- Scroll down to Miscellaneous
- Find Access data sources across domains
- Change the value to Enable
这篇关于IE 10& 11 CORS状态0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文