[英]jQuery Ajax cors IE10 not working
I'm using jQuery to do a post request to a different domain. 我正在使用jQuery向其他域发出发布请求。 This works fine on FF, Chrome and IE7,8 and 9. I was not expecting not to work on IE10..any ideas?
在FF,Chrome和IE7,8和9上都可以正常工作。我没想到不要在IE10上工作。 Here's the code
这是代码
var url = "http://xxxxxxx/xxxx.php?";
jQuery.ajax({
type: "POST",
async: false,
crossDomain: true,
contentType: "application/json; charset=utf-8",
url: url,
dataType: "json",
data: JSON.stringify(params),
success: function (data) {
callback.call(Test, data, optional);
},
error: function ( jqXHR, textStatus, errorThrown) {
alert(textStatus + errorThrown);
}
});
Maybe security zones in IE has something to do with it? 也许IE中的安全区域与它有关? https://msdn.microsoft.com/en-us/library/ms537505(VS.85).aspx#xdomain
https://msdn.microsoft.com/en-us/library/ms537505(VS.85).aspx#xdomain
Tldr; Tldr; It is possible that IE will not allow CORS, if it uses Native XMLHTTP, and if the two domains are in certain different security zones.
如果IE使用本机XMLHTTP,并且两个域位于某些不同的安全区域中,则IE可能不允许CORS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.