Forum Moderators: open
My question is how to put these scripts in the external file. Do I just add the various scripts one after the other, rather like styles in a CSS file, and the HTML pages will be able to call upon the relevant script/s as and when they're needed? Is it just as simple as that, or is there anything else I need to do, or are there any pitfalls I should be aware of?
This question is so basic that I haven't been able to find an answer to it anywhere I've searched! But when you're starting out you need to know, don't you?!
Create a new file with the extension .js.
Do not include opening and closing SCRIPT tags in the js file!
Include the javascript page in your html document like this:
<SCRIPT LANGUAGE="JavaScript" SRC="myscript.js"></SCRIPT>