本人菜鸟一枚,现在最头痛的问题就是利用Ajax的时候,其他浏览器都可以用包括IE10,都可以用,用过IE9进行调试,什么数据都没返回来,也没报错,目前的JQuery版本是1.11.0,之前用过1.6.2和1.7的版本,发现都行不通,求大神来解答啊!!
$.ajax ({
type: "POST",
async: true,
url:' URL + "/www/doLogin.dc"',
xhrFields: {
withCredentials: true,
},
data: {
mobile: mobile.val(),
password: password.val()
},
success: function(data) {
console.log("成功请求返回");
$("#err").attr("style", "display:none");
if(data.result == "1") { //输入正确
$("#d6").attr("style", "display:block");
$("#pageCover").attr("style", "display:block");
$("#phnameid").text("欢迎," + mobile.val().replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'));
$("#adbutton").click(function() {
window.location.href = URL + "/screen/welcome.dc";
});
$("#imgicon5").click(function() {
$("#d6").attr("style", "display:none");
$("#pageCover").attr("style", "display:none");
$("#d1").attr("style", "display:none");
window.location.href = "index.html";
});
} else { //输入错误
alert("进入后报错了");
$("#err").attr("style", "display:block");
$("#err").html(data.message);
return false;
}
}
});