> Where do you save a .js file in JavaScript?

Where do you save a .js file in JavaScript?

Posted at: 2014-12-18 
Not sure what "call it from within the JavaScript program" means, but I'll simply address how to use a *.js file.

You use them on web sites; besides inserting a script directly into your HTML code, you can also state a src attribute in the opening script tag:



This will include the script, provided the browser can find it. In the above example, the browser will look for it in the current folder, i.e. the one the current HTML document is in.

So "saving it to the server" refers to the fact that provided the html document is on the server, you have to copy the script file right next to it, as in, upload it to the same folder.

If you are currently creating an HTML document on your own computer and saving it to your hard drive, just save the script file to the same folder.

The instructions I was given said save the file the .js file to the server. What exactly does this mean? How do I do it?

I understand how to create a .js file and how to call it from within the JavaScript program. What I don't know is the bit in between.