Example: Create a Global Script File
There are three steps to implementing a global script file:
Create the script file using Notepad (or another text editor). This is the file that contains all of the script code. Save this file with a .js extension.
Add a <SCRIPT> tag to the <HEAD> tag of each HTML file. This links the code in your global file to the page. The tag should look like this:
If you are creating a compiled help (.chm) file, add the file name of your master script file to the [FILES] section of your project (.hhp) file.
You can call scripts that are stored in a global file the same way you would call script code that is actually on the page. For example, if you created a global file with function Func(), you could reference it like this: <a onclick="Func()">.
- You can create more than one global script file.
- This procedure can be used with any scripting language.