我有以下工作正常的代码:
success: function (upd_rsp){
//if email is not register
if(upd_rsp == "email_no"){
exstInfo.text("This E-mail is not registered in our Database!");
exstInfo.addClass("error");
return false;
}
//if email & pass don't match
if(upd_rsp == "email_pass_no"){
matchInfo.text("Email and Password don't match!");
matchInfo.addClass("error");
return false;
}
现在,如果我在这两个“if”之间放置一个“else”语句(如下),则第二个“if”不会被执行。我哪里错了?
else{
exstInfo.text("");
exstInfo.removeClass("error");
return true;
}
解决方案工作得很好。