Share via


Sys.Debug trace Method

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

Sys.Debug.trace(text);

Arguments

  • text
    The text to display.

Remarks

You can create a trace console on a Web page by adding a textarea element and setting its id attribute set to "Trace Console".

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

Example

The following example shows a click handler function that writes a line to the trace console. The example assumes the existence of an HTML element named Text1 in the default form element of the page. This is part of a larger example from the Sys.Debug class overview.

function btnTrace_onclick() {
    v = form1.text1.value;
    Sys.Debug.trace("Name set to " + "\"" + v + "\".");
    alert("Hello " + v + ".");
}
function btnTrace_onclick() {
    v = form1.text1.value;
    Sys.Debug.trace("Name set to " + "\"" + v + "\".");
    alert("Hello " + v + ".");
}

See Also

Reference

Sys.Debug Class

Concepts

Debugging and Tracing Ajax Applications Overview