WebStorm No locally stored library

I am working on a project that works entirely on jsfiddle.net. However, when I try to run this project in webStorm, I get two errors.

at first: document is not defined

second: no locally stored librarry

I used to post my question here, I searched on stackoverflow, but could not find any solutions. I have already done:

libraries: libraries that i loaded

and my html codes:

<!DOCTYPE html> <html> <head> <title>Super Mario!</title> <link rel='stylesheet' type='text/css' href='myMario.css'/> <script type='text/javascript' src='//code.jquery.com/jquery-1.11.2.min.js'></script> </head> <body> <img src="http://i1061.photobucket.com/albums/t480/ericqweinstein/mario.jpg"/> </body> </html> 

why did you get these errors even though I downloaded the libraries and successfully detected the script source in my html? what should I do?

+7
javascript jquery webstorm
source share
2 answers

You need to select this link and press Alt + Enter to load this file into your library.

Screen from WebStorm:

screen from WebStorm

+13
source share
  • It seems that you get an error message when starting your .js file directly using "Run file_name.js" in the right-click menu, right? In doing so, you launch it using Node.js. But the β€œdocument” cannot be used in server-side scripts executed by Node.js. It is defined only on client javascript, i.e. When launched in a browser using a tag in rendered HTML, and not on a Javascript API server running on the server. BTW, your .js file is not even included in your HTML page, as far as I can see from the HTML code snippet ...

  • This is actually not an error ... WebStorm cannot use the remote resources available through the CDN links to complete. When he "sees" such links, he searches for the appropriate library in ~ .WebStorm9 \ system \ extLibs \, and if the corresponding library is not found, you are prompted to download it, showing this warning. You can either suppress this warning or agree to load the library: press Alt + Enter, and then either press the right arrow, or select "Suppress for tag" or press Enter to load.

+8
source share

All Articles