Creating and Editing Scripts on HTML Pages
You can create client-side scripts for your HTML page in HTML View of the Microsoft Script Editor. Build a function by selecting an object, assigning an event to the object, and completing the appropriate script arguments.
To change the defaultClientScript property while editing a Web page
- Select the page in the Script Editor.
- From the drop-down menu at the top of the Properties window, select Document.
- Select a value for the defaultClientScript property.
-
If you adjust the defaultClientScript property to a value different than the default, a
META NAME=VS_DEFAULTCLIENTSCRIPT
tag is inserted into the<HEAD></HEAD>
section of your page. For instance, if you select VBScript, the following tag is added:<META NAME=VS_DEFAULTCLIENTSCRIPT CONTENT="VBScript">.
Note You can also specify the scripting language for a particular SCRIPT by including a type (HTML 4.0 and above) or language (HTML 3.2) attribute in the <SCRIPT></SCRIPT> tag.
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
To create a new handler function for an event
- Open your Web page in HTML View.
- Select an object on your page in the Object drop-down list box (see below).
- Select an event from the Event drop-down list box.
A new blank handler function is added to a "clientEventHandlers" or "serverEventHandlers" <SCRIPT> block in the
<HEAD>
of your page. - Complete this new function by writing arguments.