Aaron Gustafson gives us a very handy tool for debugging scripts: jsTrace.Skip to comment form
alert function is both incredibly annoying and very useful at the same time. It’s annoying if you’re visiting a site and you’re suddenly assaulted by a dialogue box. But it’s very useful if you’re debugging a script and you need to find the value of a variable at a given time: simply insert an
alert statement in the relevant place.
Still, at some point the annoyance begins to outweigh the usefulness.
Flash, meanwhile, has a much more unobtrusive way of displaying and tracking messages. Using the
trace command in Actionscript, you can write messages to a discrete window. The flow of your functions isn’t interrupted and you get a history of messages instead of clicking each one away.
This could prove to be a very handy tool for debugging scripts. And when you’re finished debugging, you can remove the link to the jsTrace script but still leave the trace commands in your code.
If you have any feedback on the script, you can leave a comment on Aaron’s blog, Easy Reader.
Post a Reply
Comments are closed.