var a = "您还有以下项目的必填项未填写,请填写完毕之后再提交审批" + "\n" + "\n";
if ((planProjectList != null && planProjectList != "") || (planTrainList != null && planTrainList != "") || (planOther != null && planOther != "")) {
if (planProjectList != null && planProjectList != "") {
for (var i = 0; i < planProjectList.length; i++) {
a += planProjectList[i] + "\n";
}
alert(a);
}
return;
}
解释一下:要达到的效果是把这个planProjectList的所有内容都显示在一个弹框内,就是进行字符串的拼接,并且换行
"\n"是换行符,这样写就可以实现了,如下图所示,就是要实现这样的效果