IE 10 & 11 CORS Status 0

邮差的信 提交于 2019-12-21 17:39:02

问题


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.

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
   }
});

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?

Why do I get the follow error in IE 10,11?

{"readyState":0,"status":0,"statusText":"Error: Access is denied.\r\n"}

回答1:


So I needed to enable 'Access data sources across domains'.

Steps:

  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


来源:https://stackoverflow.com/questions/23229723/ie-10-11-cors-status-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!