You can call debug.setOutput() to route all output to a specific HTML control in real time. If you have trace enabled it will write the output from write and writeLn to the specified control.
A default instance called _debug gets instantiated into the page so it can be used at any time where the script library is loaded.
// *** All debug output now goes to the divDebug panel _debug.setOutput("divDebug"); // *** Write some debug output _debug.writeLn("Color me purple");
Member | Description | |
---|---|---|
clear | Clears the output buffer and if set the target output control. o.wwDebug.clear() | |
output | Writes the specified output into the debug buffer and output window. This method overrides any existing debug content. o.wwDebug.output(Output) | |
setOutput | Determines where debug output is sent to. By default debug output is created into a string which can be retrieved with toString(). Calling setOutput() also writes any new debug output directly into an HTML element's innerHTML. o.wwDebug.setOutput(elementName) | |
toString | Returns the generated debug output buffer. o.wwDebug.toString() | |
write | Writes the specified message to the debug output. Output goes to an additive buffer and if a setOutput was called also echos to the output target control. o.wwDebug.write(message) | |
writeLn | Like the write method but adds a <br/> at the end of the message. o.wwDebug.writeLn(Message) |