Reputation: 105
I recently started using WebStorm and I wanted to use jQuery inside of it. Now I followed like the general guidelines on the internet to install the library but it still doesn't recognize the $
symbol when I use it.
What should I do?
Upvotes: 0
Views: 2247
Reputation: 1
Add a reference to jquery on your html page.
Use "Download library" command from context menu. I found it at "src" attribute of "script" tag.
Upvotes: 0
Reputation: 105
Haha, I found it. I changed my jquery code to a local file and simply didn't know it needed a .js at the end. Now it works. This drove me insane for two hours hahaha. Thanks for helping.
Upvotes: 0
Reputation: 1053
Download a copy of the JavaScript files on your file system and include it as external lib to your project (even if you use CDN versions of the libs with your project). Then WebStorm/PhpStorm/IntelliJ etc. can analyse the code (works with the .min-versions as well) and offers code completion etc.
Even more simple example with PhpStorm:
A cleaner method is to add it as external library, if you do not want to have a copy of jQuery in sources. However, I do not know, if WebStorm has a comparable option like that, as it has less functionality than PhpStorm or even IntelliJ.
Upvotes: 2