jqury登录
//登录
function log() {
var userName = $("#userName").val();
var pwd = $("#pwd").val();
var yzm = $("#yzm").val();
$.ajax({
url: "../ajax/GetYZM.aspx",
type: "post",
success: function (data) {
var yzmCode = data + "";
if (yzm != yzmCode) {
alert("验证码不正确!请重新输入");
return false;
} else {
if (userName != "" && pwd != "") {
$.ajax({
url: "../ajax/logining.aspx",
data: {
"userName": userName,
"pwd": pwd
},
type: "post",
success: function (data) {
if (data == 1) {
alert("登录成功!请及时填写有关资料以便找回密码。");
location.href = "personCenter_infor.aspx";
} else {
alert("登录失败!");
}
},
error: function () {
alert("登录处理错误");
}
});
} else {
alert("请填写完整");
}
}
},
error: function () {
alert("验证码获取错误");
}
});
}