Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm There is no locally stored library

I'have been working on a project which totally works on jsfiddle.net . However, when i try to run this project in webStorm, i get two errors.

first : document is not defined

second : no locally stored librarry

Before, i post my question here, i searched on stackoverflow but couldn't find any solutions. I already did :

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 u get these errors although i loaded libraries and succesfully defined source script in my html ? what should i do ?

like image 222
Emre Avatar asked Mar 17 '15 11:03

Emre


2 Answers

You need to select this file link and click Alt + Enter to download this file to your library.

Screen from WebStorm:

screen from WebStorm

like image 88
Fryderyk G Avatar answered Nov 03 '22 15:11

Fryderyk G


  1. Seems that you get the error when running your .js file directly, via 'Run file_name.js' in it's right-click menu, right? When doing this you are running it using Node.js. But 'document' can't be used in server-side scripts executed by Node.js. It is only defined in client-side javascript, i.e. when running in the browser via a tag in the rendered HTML, not the Javascript API engine running on the server. BTW, your .js file is not even included in your HTML page, as far as I can see from HTML code snippet...

  2. This is not actually an error... WebStorm can't use remote resources available through CDN links for completion. Once it 'sees' such links, it searches for the corresponding library in ~.WebStorm9\system\extLibs\, and, if matching library is not found, prompts you to download it by showing this warning. You can either suppress this warning or agree to download the library: hit Alt+Enter and then either hit the right arrow and choose 'Suppress for tag' or hit Enter to download.

like image 30
lena Avatar answered Nov 03 '22 15:11

lena