簡體   English   中英

jQuery Ajax cors IE10無法正常工作

[英]jQuery Ajax cors IE10 not working

我正在使用jQuery向其他域發出發布請求。 在FF,Chrome和IE7,8和9上都可以正常工作。我沒想到不要在IE10上工作。 這是代碼

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

也許IE中的安全區域與它有關? https://msdn.microsoft.com/en-us/library/ms537505(VS.85).aspx#xdomain

Tldr; 如果IE使用本機XMLHTTP,並且兩個域位於某些不同的安全區域中,則IE可能不允許CORS。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM