Unresolved function or method phpstorm $ ()

I have the following problem: phpstorm does not recognize jquery methods, and in some places I see

enter image description here

Unresolved function or method $ ()

This caused me some time, but finally I tried to get rid of it using File-> Settings-> JavaScript-> Libraries and adding jquery as a global / project.

My library setup looks like this: enter image description here

But nothing has changed. I still see these annoying notices. Does anyone know how to get rid of them?

+45
phpstorm
Feb 06 '14 at 23:59
source share
4 answers

There is a really stupid workaround,

Download the library (in this case jQuery ) from the innermost environment.

  • Open Settings (Ctrl + Alt + S on Linux)
  • Go to Languages ​​and Structures β†’ Javascript β†’ Libraries
  • Click Download and select jQuery

Let's hope the errors disappear

Greetings

EDIT: After starting the IDE via Fiddler, I realized that this solves the problem only because of the IDE download version.

So, the right solution is to add old, non-AMD jQuery versions as a library with global reach and add the latter as a library of project areas.

Most recent non-AMD versions:

1.10.2 for the 1.x series. And 2.0.0 for the 2.x series.

+74
Sep 14 '14 at 20:00
source share

JQuery v1.11.0 shows exactly the same behavior here. At the same time, the previous version 1.10.2 works fine in the IDE (no warnings).

I think this has something to do with the "AMD-fy jQuery source" bit ( http://bugs.jquery.com/ticket/14113 ) - it seems like there are some in the IDE inventing this style.

If you want (and you can) roll back to jQuery v1.10.2 (which looks like six months, which means it's stable and still good to use).

We hope that the IDE can correctly parse this new jQuery style in the next version.




Actual ticket: http://youtrack.jetbrains.com/issue/WEB-10908

+3
Feb 09 '14 at 17:11
source share

I had the same problem with version 1.11.2, and I solved it simply by adding an uncompressed version to the js folder.

+3
Mar 26 '15 at
source share

If you import both 1.11.0 and 1.10.2 into phpstorm, this will be allowed

You do not need to roll back your project.

+1
Apr 16 '14 at 11:24
source share



All Articles