Why IntelliJ Idea doesn't recognize the dollar operator of JQuery?
Asked Answered
L

2

35

IntelliJ shows a warning "Unresolved function or method $()" when mouse over the $ sign despite the file is in the same directory as js file. So I can't take advantage of intellisense when typing $ functions.

Just one line of code and the IDE didn't recognize it. But it works. How can I fix this problem?

$(".container").get(0).appendChild(proDiv);
Lissome answered 4/5, 2016 at 22:2 Comment(1)
@Mifeet I don't think this is a duplicate of that question, since the question you referred was about a bug in the IDE that was already fixed a year ago.Luxury
L
91

I have found the solution by myself.

  1. First press CTRL + ALT + S and go to settings.
  2. Then click from the menu Languages & Frameworks
  3. Select JavaScript from the section below and select Libraries
  4. In the open menu on the right, click on the Download button and select jquery from the list.
  5. Download it and apply. It is done.

downloading a library with IntelliJ

Lissome answered 4/5, 2016 at 22:55 Comment(3)
If you require a specific version of jQuery: Download the js file and store it somewhere meaningful. Then click Add... instead of the fourth step, specify name and framework type, and attach the js file.Servomotor
You may need to restart the application.Farrahfarrand
If adding the file yourself (e.g. if you require a specific version) you will need to import the unminified version of the file.Okajima
H
0

a solution is just to type npm install jquery in ur Rider Terminal and it will get installed by itself. I hope this was usefull.

kind regards

Hideaway answered 30/1, 2023 at 10:2 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Broil

© 2022 - 2024 — McMap. All rights reserved.