|
|
Q1121 Is there a way to place all the functions in one JavaScript file, if there is, how would I call a function in that file from the HTML page?
irt.org | Knowledge Base | JavaScript | source | Q1121 [ previous next ] Q1121 Is there a way to place all the functions in one JavaScript file, if there is, how would I call a function in that file from the HTML page?Put your script in a file with extension .js If your script looks like this before:
The file test.js looks like this (cut and paste what is between the script tags except the javascript cloak comments:
And the script tags now look like this:
Your server needs to have the mime type application/x-javascript set up for .js extensions. One server that doesn't have that as default is IIS3. The SRC attribute of the script tag is not supported by Netscape Navigator 2 and Internet Explorer 3. |
-- div -->
|