Compilation error using jquery-1.7.1.min.js

I am trying to run a dynamic web project using maven and spring. I have code that uses jquery-1.7.1.min.js. But I see a compilation of errors in the file. Below is a screenshot of the errors.

Someone had the same problem ever, or know how to fix it.

the compile errors shown up in eclipse

thanks

+6
source share
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, follow these steps:

1) Right-click the Project root folder in the Project Explorer Explorer Eclipse view

2) Go to Properties → JavaScript → Enable Path → Source Tab

3) Select “Excluded” and “Change ...” and then “Add”.

4) Now you can either view the JavaScript file with errors, or simply enter a substitution pattern that excludes anything that matches your pattern. In my case, I introduced ** / jquery * .js to exclude all jQuery library files.

5) Then you can click “OK”, “Finish” and “OK” again

6) The message Building Workspace should now appear in your Eclipse progress view

7) Tada! The error symbol has disappeared!

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

+9
source

If these errors come from your jquery source file, this is normal in eclipse. If they are from your own javascript files, this could be a problem.

Eclipses of javascript warnings are mostly useless. Javascript minifiers purposefully removes semicolons due to ASI, and eclipse cannot handle this very well.

Checking my local jQuery file, I get almost the same list of warnings and errors.

+2
source

Source: https://habr.com/ru/post/915226/


All Articles