$.ajax({
type : "GET",
url : "ea/login",
data : {
username : $("#username").val(),
password : $("#password").val(),
type : type
},
dataType : "json", //预期服务器返回的数据
success : function(data) {
if (data.errCode < 0) {
alert("登录失败!")
$("#errMsg").show().html(data.errMsg).stop(true, true)
.fadeOut(3000);
} else {
//登录成功,做其他处理
alert("恭喜你,登录成功!");
}
}
});
ajax访问后台
最新推荐文章于 2024-04-10 18:16:08 发布