项目用到jquery,但将Jquery拷进去后,js文件有个红叉,看上去非常不爽。如下图:
解决方法:
1.找到项目下的.project文件
2.去掉Javascript验证
1 <?xml version="1.0" encoding="UTF-8"?> 2 <projectDescription> 3 <name>Struts2_Jquery_Json</name> 4 <comment></comment> 5 <projects> 6 </projects> 7 <buildSpec> 8 <!-- 9 去掉JavaScript验证 10 <buildCommand> 11 <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> 12 <arguments> 13 </arguments> 14 </buildCommand> 15 --> 16 <buildCommand> 17 <name>org.eclipse.jdt.core.javabuilder</name> 18 <arguments> 19 </arguments> 20 </buildCommand> 21 <buildCommand> 22 <name>org.eclipse.wst.common.project.facet.core.builder</name> 23 <arguments> 24 </arguments> 25 </buildCommand> 26 <buildCommand> 27 <name>org.eclipse.wst.validation.validationbuilder</name> 28 <arguments> 29 </arguments> 30 </buildCommand> 31 </buildSpec> 32 <natures> 33 <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 34 <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> 35 <nature>org.eclipse.wst.common.project.facet.core.nature</nature> 36 <nature>org.eclipse.jdt.core.javanature</nature> 37 <nature>org.eclipse.wst.jsdt.core.jsNature</nature> 38 </natures> 39 </projectDescription>
3.修改.project文件后,需要重新拷贝js文件到项目中