首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

MyEclipse的JSP开发中form中的onclick中的return有关问题

2012-01-30 
MyEclipse的JSP开发中form中的onclick中的return问题我发现eclipse中写事件时不能用return?例如input typ

MyEclipse的JSP开发中form中的onclick中的return问题
我发现eclipse中写事件时不能用return?
例如<input type='submit' value='log' onclick='return checkForm();'/>
myeclipse提示说Cannot return from outside a function or method
但是我如果直接在webapps里面改掉jsp文件,在那里使用return则文件能正常运行,说明代码没有问题,
是不是myeclipse这里有bug?
怎么解决呢?


[解决办法]
最好别这么写吧

<input type='submit' value='log' onclick='checkForm();'/>

在 checkForm() 里边做跳转就可以了,我一直都这么做的

热点排行
Bad Request.