跨域AJAX调用在IE11不工作

问题描述 投票:1回答:1

我想一个让跨域AJAX调用。它的工作原理在Chrome和Firefox,但不是在IE11。 IE11似乎下降AJAX调用。 IE11开发者工具网络发现,请求甚至没有到url做。下面是代码,我有段。

$(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
1个回答
0
投票
$.ajax({
    type : "GET",
    cache: false,

或Ajax调用之前

   $.ajaxSetup({ cache: false });

   $.ajax({
    type : "GET",
© www.soinside.com 2019 - 2024. All rights reserved.