在实验室的电脑上web项目正常运行,没有报错,回来在自己的myeclipse上导入项目,却发现jsp中“Cannot return from outside a function or method” 提示return出错,在网上查了一下,解决方法如下:
1.jsp网页出现“Cannot return from outside a function or method” 提示return出错时:
打开window -->preferences -->myeclipse -->validation-->右边框 -->javascript validator for Js files 把Bulid 复选框的勾去掉,点击右下角的apply之后等待一分钟便生效。
2.onSubmit(), false 仍然跳转,onSubmit="return checkForm()" ,onsubmit属性中要写"return checkForm()",而不仅仅是
" checkForm()"