function check() {
if(Trim(document.reply.title.value) == "") {
alert("please intput the title!");
document.reply.title.focus();
//return false;
}
alert("please intput the content!");
if(Trim(document.reply.cont.value) == "") {
alert("please intput the content!");
document.reply.cont.focus();
return false;
}
return true;
}
javascript里面两个if,为什么只有当第一个if括号里面为true时,下面的语句才可以执行?
javascript里面两个if,为什么只有当第一个if括号里面为true时,下面的语句才可以执行?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答
- Go 旅城通票 2016-11-22 04:52关注
你下面的语句指什么,alert("please intput the content!");之后的?
就你这个代码是不是true都会执行下面的代码,有个可能就是true不执行下面的,而不是执行下面的,为true会执行代码段,如果报错就不会继续执行了,而不是执行
解决 无用评论 打赏 举报