Using Webstorm

I've just started to try and use Webstorm and am not having any luck.

I've been searching what documentation there is but it's pretty hopeless.

How do you get Webstorm to 'see' more than one file at a time?

If I put everything into an HTML file and run that, it works, but as soon as I try and move functions to a JS file they are not seen.

It is pretty vital that you can have a project split into multiple files and yet there is nothing anywhere to suggest how to make that worlk.

3 comments
Comment actions Permalink

>How do you get Webstorm to 'see' more than one file at a time?

it 'sees' as many files as you open in it. But, as all other IDEs, it's designed to work with projects, not individual files. See https://www.jetbrains.com/help/webstorm/2020.2/getting-started-with-webstorm.html#ws_getting_started_open_project

>If I put everything into an HTML file and run that, it works, but as soon as I try and move functions to a JS file they are not seen

 

not seen by what - IDE or browser? It's not Webstorm that runs your code. Did you link your javascript to HTML page with <script src="path/to/js"> tag?

0
Comment actions Permalink

I looked at the page you quoted, but it's absolutely useless.

I thought that the point of an IDE was that it organised the project so that it all linked together.

I added that tag, (I tried both full path and simple file name), but it makes no difference. I still get exactly the same error: "Uncaught ReferenceError: Function is not defined".

Where is the documentation that explains how to do this?

-1
Comment actions Permalink

>I added that tag, (I tried both full path and simple file name), but it makes no difference. I still get exactly the same error: "Uncaught ReferenceError: Function is not defined".

 

This is a runtime error that has nothing to do with the IDE; something must be wrong with your code

Please share your .js and .html files

 

1

Please sign in to leave a comment.