InstaCode

InstaCode helps you write code by providing a list of objects, properties, and methods that are appropriate completions to code you have started to type. As you type in the script editor, you can press F2 to get a list of suggestions.

InstaCode completes code in two ways:

The list of suggestions depends on the context. In a client script, you see objects belonging to the document object model and objects you have inserted in the HTML page, such as HTML elements and components. In a server script, you see objects belonging to the object model for the selected server.

StepsTo use InstaCode:

  1. Type part of an object name and press F2.

  2. Select an item from the list. (To close the list without making a selection, press esc or click the close box.)

Examples

StepsTo insert the window object and the alert method in a client script:

  1. On a blank line or after a space, type "w" and press F2.

  2. Select "window" from the list.

  3. Type "." after "window" and press F2.

  4. Select "alert(message)" from the list.

The script now contains the code "window.alert(message)". Edit the method argument if necessary.

StepsTo insert the scroll method for the window object in a client script:

  1. On a blank line or after a space, type "s" and press F2. Because window is the default object, the list displays window methods and properties.

  2. Select "scroll(x,y)" from the list.

The script now contains the code "scroll(x,y)".

StepsTo insert the Write method for the psDocument object in a server script:

  1. On a blank line or after a space, type "ps" and press F2.

  2. Select "psDocument" from the list.

  3. Type "." and press F2.

  4. Select "Write(string)" from the list.

The script now contains the code "psDocument.Write(string)".