External Libraries and <script> in HTML file


I'm quite new to WebStorm and even quite unexperienced with JavaScript. Now, I want to start a bigger JavaScript project using WebStorm 6.
After my first attempt to walk with WebStorm 6, a question came up:

How can I reference an External Library in the <script> element of the HTML file ?

Is it right to reference an External Library from <script>? Or, do I have to copy the used external library into the project folder (i.e. to scripts/libs) additionally?
Is the only purpose of an External Library to enable code completion, quick fix ... in JavaScript files of the project?

I search the docs some hours but I found no clear answer for my questions :(

Can sombody pls clearify?


Comment actions Permalink

Hi Klaus,

exactly - the only purpose of an External Library is to enable code completion, navigation, etc. in our javascript files. Libraries configured in WebStorm are not passed to the browser when you run your application, so you need to specify the correct URL in the src attribute of a <script> tag in your HTML to get the libraries loaded by your browser. It may be absolute (http reference), relative to document or site root-relative (see http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7c44a.html, for example)

Best regards,

Comment actions Permalink

Thank you very much, Lena, that helped me!


Please sign in to leave a comment.