Creating and Editing Scripts on HTML Pages

Microsoft Script Editor

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

  1. Select the page in the Script Editor.
  2. From the drop-down menu at the top of the Properties window, select Document.
  3. Select a value for the defaultClientScript property.
  4. 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:


    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

  1. Open your Web page in HTML View.
  2. Select an object on your page in the Object drop-down list box (see below).

Object drop down art

  1. 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.

  2. Complete this new function by writing arguments.