Use external JavaScript files (*.js) files when you want to separate lengthy JavaScript routines from HTML. This is a convenience for the programmer.
The following HTML demonstrates usage and syntax:
<HTML>
<HEAD>
<TITLE>js test</TITLE>
<SCRIPT LANGUAGE="JavaScript" SRC="module.js">
</SCRIPT>
</HEAD>
</HTML>
where the following content is in a text file called module.js:
//
// (c)1998 Bryan Wilhite
// All rights reserved.
// rasx@kintespace.com
//
// This JavaScript file kicks much ass.
//
alert("hello")