IE 10& 11 CORS状态0 [英] IE 10 & 11 CORS Status 0

查看:75
本文介绍了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'.

步骤:


  1. 选择互联网选项

  2. 选择安全选项卡

  3. 选择自定义级别...

  4. 向下滚动到其他

  5. 跨域查找访问数据源

  6. 将值更改为启用

  1. Select Internet Options
  2. Select the Security Tab
  3. Select Custom level...
  4. Scroll down to Miscellaneous
  5. Find Access data sources across domains
  6. Change the value to Enable

这篇关于IE 10& 11 CORS状态0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆