This is an archived page. It's not actively maintained.


The debug.writeln function sends strings to the script debugger, followed by a newline character.


Debug.writeln([str1 [, str2 [, ... [, strN]]]])


str1, str2, ... , strN Optional
Strings to send to the script debugger.


The Debug.writeln function sends strings, followed by a newline character, to the Immediate window of the Microsoft Script Debugger at run time. If the script is not being debugged, the Debug.writeln function has no effect.

The Debug.writeln function is almost identical to the Debug.write function. The only difference is that the Debug.write function does not send a newline character after sending the strings.


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

Note: 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.writeln("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, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1).

Applies ToDebug

See also