: On my website I have a javascript, but this is on everypage and if i want to add something to it i have to update each page. How do I use '.js' or '.class' files within a html document, if this is what im needing.
:
: Thanx
:
All you need to do is place the script in a source file and call it myScript.js or whatever name you like. Assuming you place this at your root and the pages that you wish to use it in are also at the root, place the following tag between the openning and closing <head> tag of every page you wish to use the script in:
<script language="JavaScript" type="text/javascript" src="myScript.js">
Of course, you would need to replace myScript.js with whatever name you gave it.
If your html page is somewhere other than where the script source resides, then you need to put the relative path along with the source file name in the src attribute of the <script> tag, the same way you would refer to an image or a document that resides in a folder other than that of the page you are making the link in.
Happy Computing,
Arash Sayadi
15530-B Rockfield Blvd. Suite 4
Irvine, CA 92618
949-830-1623 x36
949-830-2120 Fax
www.pts1.com
arashs@pts1.com