Sys.Debug Class

Provides debugging and tracing functionality for client ECMAScript (JavaScript) code. This class is static and can be invoked directly without creating an instance of the class.

Namespace: Sys

Inherits: None

debug.trace(message);

Name

Description

Sys.Debug Constructor

Initializes a new instance of the Sys.Debug Class.

Sys.Debug assert Method

Checks for a condition, and if the condition is false, displays a message and prompts the user to break into the debugger.

Sys.Debug clearTrace Method

Clears all trace messages from the trace console.

Sys.Debug fail Method

Displays a message in the debugger's output window and breaks into the debugger.

Sys.Debug trace Method

Appends a text line to the debugger console and to the trace console, if available.

Sys.Debug traceDump Method

Dumps an object to the debugger console and to the trace console, if available.

By calling methods of the Debug class, you can display objects in readable form in the debug console, show trace messages, use assertions, and break into the debugger.

The assert method should be used to catch developer errors. To respond to user errors and run-time conditions such as network errors or permissions failures, throw an exception.

Debugging behavior, requirements, and the output of trace messages vary with different browsers. For more information, see Debugging and Tracing Ajax Applications Overview

The following example creates a Web page that demonstrates the methods of the Debug class.

No code example is currently available or this language may not be supported.
Show: