我使用的是HTML5,jQuery 1.6.1,jQuery Mobile 1.0.1。withCredentials屬性在Firefox中不受支持
我正在使用下面的代碼來發出Ajax請求。它在Chrome中工作正常,但在Firefox 14.0.1中測試時出現以下錯誤。
窗口上下文中的同步模式不再支持使用XMLHttpRequest的withCredentials屬性。
代碼:
$.ajax({
type: "GET",
dataType: "json",
async: false,
beforeSend: function (xhr){
xhr.setRequestHeader('Authorization', make_base_auth(UserId, Password));
},
xhrFields: {
withCredentials: true
},
success:function(data){
console.log("Success");
},
error:function(xhr,err){
console.log("Failed");
}
});
請幫我出這一點。
我希望我可以upvote這個答案額外50倍。非常感謝你 - 你剛剛結束了兩個小時的錯誤修復會議。 –
6小時給我! –
@tinytiger很高興聽到:) –