Debug object
With the Debug object, you can send messages to the output window of the opened script debugger in Internet Explorer.
- The Debug object cannot be instantiated.
- The members of the Debug object are static, they can only be accessed through the Debug object (Debug.member).
- The Debug object is available anywhere within the JavaScript code.
Note: the script debugging applications can also be opened with the debugger statement directly.
The Debug object supports the write and writeln methods to send messages to the output window of the opened script debugger.
To send messages to a console in Firefox, use the reportError method for the Error Console and the dump method for the Console window. In Opera, use the postError method for the Error Console.
Syntax:
Sending a message to the output window of the debugger:
Debug.write (message);
Members:
The Debug object inherits from the Object.prototype object.
The following list only contains the members of the Debug object.
Methods:
Method | Support | Description | |||||||
---|---|---|---|---|---|---|---|---|---|
write ([message1 [, message2 [, ... [, messageN]]]]) |
Sends messages to the script debugger.
|
||||||||
writeln ([message1 [, message2 [, ... [, messageN]]]]) |
Sends messages to the script debugger, followed by a newline character.
|
Examples:
Sending message to the console:
|
External links:
User Contributed Comments