Adding VBScript Code to an HTML Page

You can use the SCRIPT element to add VBScript code to an HTML page.

The ‹SCRIPT› Tag

VBScript code is written within paired ‹SCRIPT› tags.

Beginning and ending ‹SCRIPT› tags surround the code. The LANGUAGE attribute indicates the scripting language. You may specify the language because browsers can use other scripting languages.

You can use SCRIPT blocks anywhere in an HTML page.

You can put them in both the BODY and HEAD sections.

However, you will probably want to put all general-purpose scripting code in the HEAD section in order to keep all the code together. The code in the HEAD section is also read and decoded vb\before it is called from within the BODY section.

The exception to this rule is the inline scripting code within froms to respond to events of objects in your form.

Most of the code appears in either SUB or FUNCTION procedures, and will be called only when specifiedby the code. You can write VBSCript code outside procedures, but still within a SCRIPT block. This code is executed only once, when the page loads.