jquery ajax error状态

$.ajax({
type: "POST",
url: "Login/LoginAction",
data: { txtName: $("#txtName").val(), txtPwd: $("#txtPwd").val(), txtCode: $("#txtCode").val() },
success: function (data) {
if (!data.success) {
$("#errorMsg").removeClass("hid").addClass("err");
$("#errorMsg").text(data.msg);
else {
window.location.href = "/Index.html";
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) { // 通常情况下textStatus和errorThown只有其中一个有值
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
}
});
原文地址:https://www.cnblogs.com/ziye/p/2697014.html