0
在下面的代码中,即使第一个语句返回false,我仍然可以如何执行第二个和第三个语句?JavaScript语句执行顺序
// so in this one if Required fails I dont get the email error :(
function validate() {
if (checkRequired(myForm.requiredElements)
&& checkEmail(myForm.emailInputs)
&& checkTelephone(myForm.telInputs)) {
return true;
}
else {
return false;
}
}
由于答案很好,很有用,我简化了问题,让其他用户更容易找到并理解它。 – XGreen 2012-03-27 23:21:00