有两个解决方法:


方法一:myeclipse的校验去掉。

具体设置 window->preference->myeclipse->validation 去掉js的验证。


方法二:打开.project文件,注释掉里面的js验证。注意是这两处

  1. <!--<buildCommand>

  2. <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>

  3. <arguments>

  4. </arguments>

  5. </buildCommand>-->

  1. <!--<nature>org.eclipse.wst.jsdt.core.jsNature</nature>-->

然后重新编译一遍,问题就解决了