我有以下代码在Firefox,Safari
中正常工作但不在Internet Explorer中工作,
$.post(postFile, { usernamePost: username, passwordPost: password }, function(data) {
if(data.status==true)
{
$("#message").html("Correct Username or Password");
$("#message").css({color:"green"});
else {
$("#message").html("Wrong Username or Password");
$("#message").css({color:"red"});
}
}, "json");
return false;
});
消息的和html是 .....
由于
答案 0 :(得分:1)
您的语法结构错误(缺少其他左侧的大括号)
尝试:
$.post("test.php", { usernamePost: username, passwordPost: password },
function(data){
if(data.status==true){
$("#message").html("Correct Username or Password");
$("#message").css({color:"green"});
}else{
$("#message").html("Wrong Username or Password");
$("#message").css({color:"red"});
}
}, "json");