ajax参数

 $.ajax({
type: "GET",
url: "Login.ashx",
dataType: "text",
cache: false,//true使用缓存 。 false不使用缓存
async: true,//使用 true beforeSend方法会有延迟现象
data: { "Method": "Login_User", "dt": JSON.stringify(json) },
beforeSend: function () {
$('#btn_log').html('正在登陆,请稍后……');
$('#btn_log').attr('disabled', 'disabled');
},
success: function (data) {
var json = JSON.parse(data); var log = parseInt(json.code);
if (log > 0) {
window.location.href = "index.html";
return false;
} else {
alert("用户名或密码错误,请重新输入");
$('#btn_log').html('登   陆');
$('#btn_log').removeAttr('disabled');
}
},
error: function () {
alert('网络错误,请检查网络');
$('#btn_log').html('登   陆');
$('#btn_log').removeAttr('disabled');
}
});

ajax参数

上一篇:C++之路进阶——bzoj2199(奶牛议会)


下一篇:系统前端基本文件+ajax部分理解