我使用的是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很高兴听到:) –