$.ajax({
type: 'post',
async: false,
url: "/index/Login/check",
data: { "id": id, "password": password, "role_id": role_id },
dataType: 'text',
success: function (data) {
if (data == "true") {
top.location.href = "/index/index/index";
} else {
document.getElementById("error").innerHTML = data;
var v = document.getElementById('imgcaptcha');
v.src = '/index/Login/captcha?t/' + Math.random();
return;
}
}
});
$.post("/index/Login/check",
{
id:id,
password,password,
role_id:role_id
},
function(data,status){
if (data == "true") {
top.location.href="/index/index/index";
} else {
document.getElementById("error").innerHTML = data;
var v = document.getElementById('imgcaptcha');
v.src = '/index/Login/captcha?t/' + Math.random();
return;
}
});
$.get("/ajax/ajax2",{"name":"张三","age":18},function(data){alert(data.name);},"json");