I am incapable of writing any code without a trace utility. I need to see variables change over time, loop counters increment, etc. I haven't been able to find a JavaScript trace utility, so I wrote my own.
Actually, it is so simple, that maybe developers write their own when they need one. In any case, you can view it in operation here.
To get the code, either use the 'View Source' button in your browser or download this zip file.
To use it, you need to include trace.js in the html file being debugged.
Limitations:
- The html file being debugged must be in the same domain as the trace html/js files. You cannot test your pages here on my site, for example. This is a built-in JavaScript security feature.
- When the trace textbox gets full, things bog down. Click the 'Clear' button every so often.
- The trace commands should be removed when you are done debugging. Flash has an 'Omit trace commands' compile option. Html does not have that option.
