fbb

如果总是到ERROR,是因为async没有定义为false,设置为同步,数据类型要设置为text,不要用json。

示例:

if (IDcard != "")
{
$.ajax({
type: "POST",
dataType: "text",
async:false,
url: "/Ashx/CheckIDCard.ashx",
data: { IDCard: IDcard },
success: function (data) {

if (data == "True") {
$("#cphMain_lbMSG").html("已经存在此身份证号!");
}
else { $("#cphMain_lbMSG").html(""); }
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
alert(result);

}
});
}

分类:

技术点:

相关文章: