Script Outline Window

   

The Script Outline window displays the available object model for your document and the scripts on the page when you are working in Source view of the HTML editor. In the Script Outline window, you can:

  • Display a tree view of all elements on your page that have their ID or NAME attribute set.

  • Display events for each element.

  • Navigate quickly to any script in the page.

  • Quickly create new handlers for events on the page.

The Script Outline window is available in Source view of the HTML editor. In its initial state, the tree view displays nodes listed in the following table:

Node Contains
Client Objects and Events A hierarchy of the elements that support client script or have client script attached. Under the node for each element is a list of the events for which you can write handlers.
Client Scripts A set of nodes for each client script on the page. There is a node for each script block on the page, and a separate node for each function or subroutine defined within a script block.

There is also a node for inline scripts defined as part of a control definition, as in this example:

<INPUT TYPE="button"
NAME="button1"
ONCLICK="alert('Clicked!')">
Server Objects and Events A list of nodes for each element that supports server script or that has server script attached. Under each node is a list of the event for which you can write handlers.

The Server Object and Events node also displays the Microsoft Internet Information Server object model, including the Session object, Application object, and so on. In the Script Outline window, these objects do not display events.

Server Scripts A set of nodes for each server script on the page. Functions and subroutines are identified by name. Inline server script appears in tree, but is not identified by name.

Note   The Script Outline does not include elements that are added to a page using an INCLUDE file.

You can use the Script Outline window to move between scripts.

To navigate between scripts

  • Expand the appropriate script node in the Script Outline window until you see the script you want to go to, and then click the script's name. The insertion point in the edit pane moves to the script.

If you are working in a script in the edit pane, you can synchronize the Script Outline window so you can see where you are in the context of the whole page.

To synchronize your position with the Script Outline window

  • Right click anyehwere in the Script Outline window, and then select Synch Script Outline.

Creating Scripts

When you expand the node for an object in the Script Outline window, the node displays a list of events for which you can create a handler. If the event name is bold, a handler already exists for that event.

You can create new event handlers for events listed in the Script Outline window. You can also insert new script blocks even if they are not associated with a particular event.

To create a new event handler

  1. Expand the appropriate object node until you see the event name for which you want to create a script

  2. Double-click the name of the event.

    The editor inserts a new script block with a skeleton handler for the event you selected. The handler is created in the default language for the current context. For example, if you are creating a server script, the handler is in the default language for the server.

Arranging Scripts

You can arrange the nodes or script either by declaration or alphabetically.

To arrange scripts

  • Right click anywhere in the Script Outline window, select Sort, and then select Alphabetically or By Declaration.

If you arrange scripts by declaration, each script block has a node. When you open the node, it displays the names of individual procedures (functions or subroutines) and public variable. The nodes are arranged according to their order in the page.

If you arrange script nodes alphabetically, the scripts are displayed as individual nodes by their name. Script blocks that do not contain named procedures are displayed in order according to the name of the language in which they are written (for example, VBScript). If a script block contains only one procedure, the procedure name is displayed.