$.ajax({
type: "POST",
url: "ajax.php",
data: "ajaxdo=logincheck&username="+$("#username").val()+"&password="+$("#password").val(),
success: function(msg){
switch(msg){
case '1':$("#linktips").html("登录成功");
//window.location.href="admin.php";
window.location.reload();
break;
case '2':$("#linktips").html("密码不正确");
break;
case '3':$("#linktips").html("用户名不存在");
break;
default:$("#linktips").html("未知错误...");
}
}
});ie9下面始终不能执行success的function,但是ajax.php页面执行没有问题。其他浏览器很正常。
type: "POST",
url: "ajax.php",
data: "ajaxdo=logincheck&username="+$("#username").val()+"&password="+$("#password").val(),
error:function(n,msg){alert(msg);},
success: function(msg){
alert(msg);
switch(msg){
case '1':$("#linktips").html("登录成功");
//window.location.href="admin.php";
window.location.reload();
break;
case '2':$("#linktips").html("密码不正确");
break;
case '3':$("#linktips").html("用户名不存在");
break;
default:$("#linktips").html("未知错误...");
}
}
});增加2个红体警告部分,看看IE9输出的是什么!