External JavaScript files provide two advantages, first your pages will load a bit faster and secondly (and usually more importantly) search engine bots will be able to better access your real content and keywords.
1. Create your HTML page including the JavaScript you are going to use. You can do this by creating a template page, if you wish. When the page is completed, all appropriate operating JavaScript (JS) are within the <head> </head> tags.
2. Cut all the JS out of the <head> </head> area and paste into a text file you create with NotePad. Do not bother to try doing this in and Dreamweaver or and other WYSIWYG editor because there is a great potential for contamination. Do not even open the .js file in anything else but a text editor such as NotePad, otherwise you face corruption.
Note: The JS in the <body> </body> tags remain where they are. They do not go in your .js file.
3. In your text file (let's say you name it "javascript.js") remove all the <javascript> </javascript> tags. In other words, your javascript.js file would start with
<!--
and end with
//-->
There will be NO <javascript> </javascript> tags in your .js file.
4. You may even add additional JS that appear only on certain pages - but always remove the <javascript> </javascript> tags and place the scripts in your javascript.js file between the <!-- //--> tags. (Note there is only one set of these tags in your javascript.js file, <!-- at the beginning and //--> at the end.)
5. Now you are ready to place the reference to your javascript.js file in your HTML page
<script language="JavaScript" src="/javascript.js"></script>
We strongly recommend you put your javascript.js file in the root directory; however you do not, you will need to change the above to reference exactly where your external JS file is located.

If you need a great business web site, KatsueyDesignWorks is the place to start - and end - your search for a web site designer.
We provide:

KatsueyDesignWorks is a full web development company. We provide web design, web development (shopping carts and other dynamic content), web hosting, Flash media and domain name registration.