Export (0) Print
Expand All

Debug Object (JavaScript)

An intrinsic global object that can send output to a script debugger, such as the Microsoft Script Debugger.

Debug.function

The Debug object cannot be created directly, but it is always available for use.

The write and writeln functions of the Debug object display strings in the Immediate window of the Microsoft Script Debugger at run time. If the script is not being debugged, the functions have no effect.

This example uses the write function to display the value of the variable in the Immediate window of the Microsoft Script Debugger.

NoteNote

To run this example, you must have a script debugger installed and the script must run in debug mode.

Internet Explorer 8 includes the JavaScript debugger. If you are using an earlier version of Internet Explorer, see How to: Enable and Start Script Debugging from Internet Explorer.

var counter = 42;
Debug.write("The value of counter is " + counter);

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

The Debug object has no properties.

Show:
© 2014 Microsoft