Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile error with jquery-1.7.1.min.js

I am trying to run a dynamic web project using maven and spring. I have a code which uses the jquery-1.7.1.min.js. But i see compile errors in the file. The following is the screen shot of the errors.

Did any one got this same problem ever or know how to fix it

the compile errors shown up in eclipse

Thanks

like image 238
javaMan Avatar asked May 08 '12 20:05

javaMan


2 Answers

From http://imwill.com/eclipse-java-ee-jquery-validation-error-workaround/#.UK7jAOOe-I5

Workaround – How to fix To get rid of the annoying Error symbol do the following:

1) Right click your Project root folder in your Eclipse Project Explorer View

2) Go to Properties -> JavaScript -> Include Path -> Source Tab

3) Select Excluded and Edit… and then Add..

4) Now you can either browse for JavaScript file which has errors or just enter a wildcard pattern which will exclude anything matched by your pattern. In my case i entered **/jquery*.js to exclude all jQuery library files.

5) Then you can hit OK, Finish and OK again

6)Your Eclipse Progress View should now show a Building Workspace message

7)Tada! The Error Symbol is gone!

In addition to above steps I had to manually delete the old problem markers.

like image 108
vaichidrewar Avatar answered Sep 22 '22 01:09

vaichidrewar


If these errors originate from your jquery source file this is normal in eclipse. If they are from your own javascript files it might be a problem.

Eclipses javascript warnings are for the most part useless. Javascript minifiers purposefully remove semicolons because of ASI and eclipse can't handle that very well at all.

Checking my local jQuery file I get pretty much the same list of warnings and errors.

like image 23
Andrew Avatar answered Sep 18 '22 01:09

Andrew