Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webstorm: Adding jQuery via Libraries but can't add a reference in html

I added jQuery to my web project in Webstorm and sure enough I see the jQuery2-0 under external libraries, but where do I add a reference to it?

I tried using code completing in the html file for my script tags, but where is it stored? In which directory?

So in the src of these script tags where do I point it?

<script src=""></script>

Webstorm seems to have downloaded the script but I am confused about how to link to it in my html file.

like image 667
Martin Avatar asked Jun 06 '14 16:06

Martin


1 Answers

When you download a library using Download... button in Settings/JavaScript/Libraries, it's not placed in your project directory - it's saved to idea.system.path/extLibs folder (see https://intellij-support.jetbrains.com/entries/23358108 for information about IDE configuration/caches location; normally the idea.system.path is ~/.<PRODUCT><VERSION>/system on Windows/Linux and ~/Library/Caches/<PRODUCT><VERSION> on Mac).

You can copy the file (normally smth like 'http_code.jquery.com_jquery-2.0.0.js ') to your project directory and then use completion within 'src' attribute in your HTML to create a link to it, or (even better) use CDN references instead - like <script src="http://code.jquery.com/jquery-2.1.1.js"></script>.

like image 148
lena Avatar answered Nov 04 '22 17:11

lena