Stepping Through Scripts

You can use Microsoft Script Debugger to execute (step through) individual lines in a script. You can then view and check the results of each script line.

If the script calls another procedure or function, you can step into the procedure. Alternatively, you can step over the procedure. In that case, the procedure is executed, and when it finishes, you are left on the line immediately following the call to that procedure.

To step through scripts

  1. Load the document to debug in Internet Explorer.

  2. Start the debugger. For details, see Starting Microsoft Script Debugger.

  3. Set a breakpoint. See Setting Breakpoints.

  4. From the Debug menu, choose Run.

    û or û

    Switch to Internet Explorer.

  5. Client scripts: Perform an action (such as clicking a button) that causes the script to execute.

    Server scripts: Refresh the document.

    The Script Debugger stops at the first breakpoint, displaying it in the editing window:

  6. To step through the script, choose one of the following commands from the Debug menu or click one of the following buttons on the Debug toolbar:
    Command Button Action
    Step Into Moves to the next script line. If the script calls another procedure, Step Into proceeds through the lines of that procedure.
    Step Over Skips called procedures. The procedure is executed, but the debugger does not step through its individual lines. Instead, the debugger moves to the next line in the current procedure after executing the called procedure.

  7. To stop stepping through lines of a procedure before reaching its end, choose Step Out from the Debug menu or click on the Debug toolbar.

    The debugger moves to the next statement following the procedure.

  8. Continue stepping through the script until you reach the end of the document.

See Also

Debugging Java Programs

Setting Breakpoints

Viewing and Changing Values

Viewing the Call Stack