【发布时间】:2019-02-11 20:48:11
【问题描述】:
我正在尝试进行跨域 AJAX 调用。它适用于 Chrome 和 Firefox,但不适用于 IE11。 IE11 似乎放弃了 AJAX 调用。 IE11 开发者工具网络显示,甚至没有向 url 发出请求。这是我拥有的代码的 sn-p。
$(function() {
var url = "https://example.com?abc=xyz";
$.ajax({
type : "GET",
contentType : "text/plain",
url : url + "&callback=?",
dataType : 'jsonp',
xhrFields : {
withCredentials : false
},
headers : {},
success : function() {
console.log("success");
},
error : function() {
console.log("error");
},
complete : function() {
console.log("complete");
}
});
});
【问题讨论】:
标签: ajax cross-domain internet-explorer-11