You can store any script in a separate file. The SCRIPT element has an SRC attribute to refer to the file. For JavaScript, the file usually has a JS extension.
<SCRIPT Language="JavaScript" SRC="script1.js">
</SCRIPT>
There are two ways to create an external script file:
In the integrated Script editor, the Save As External File pop-up menu item stores the current client script in a file and points to that file with the SRC attribute.
The standalone Web Script editor creates a script with no specific association to an HTML document. To use the script in an HTML document, switch to Source view to edit the SRC attribute to point to the standalone script file.