$("#submit").click(function() {
var uid = $("#uid").val();
var password = $("#password").val();
var param = new Object();
param['uid'] = uid;
param['password'] = password;
console.log(JSON.stringify(param));
$.ajax({
type: "post",
dataType: "json",
url: "login",
data: JSON.stringify(param),
success: function(response){
if(response.code=='0')
{
$.toast(response.msg,'text');
setTimeout('window.location.reload()',1000);
}else{
$.toast(response.msg,'text');
}
},
error: function(XmlHttpRequest,textStatus,errorThrown){
$.toast('系统出错!','text');
}
});
});
或者:
$("#submit").click(function() {
var uid = $("#uid").val();
var password = $("#password").val();
//定义对象
var param = new