DebugWindow

This is the home of the JavaScript DebugWindow object. You can download it from here.

The purpose of this object is to provide the programmer with a tracing tool, which can be used as a replacement for alert(...) statements.

Background

Often when you are programming (in any language), you need to follow the path that the code is executing; this is often done by putting print statements at strategic places thoughout the section of code. This library snitppet implements a tracing facility equivalent to a console window, so that you can trace JavaScript; it is implemented by opening a popup window, then writing the trace statement to that window.

The technique of writing the trace statments to the popup window, is a much more 'useable' than using alert(...), as you dont have to hit 'OK' after every alert window. As a bonus, you dont have to worry whether the alert(...) caused a flush of the graphics sub-system and keyborad buffers (due to the alert window openeing, then waiting for 'enter'/'spacebar'/'escape').

Usage

To use the debug window, you should implement it like this:

<html>
	<head>
		<!-- load the debug window before the code that you need to debug -->
		<script language="JavaScript" src="debug_window.js"></script>
		...
	</head>
	<body>
		...
	</body>
</html>