Finding Out What's Wrong with Your Code
Let's say you've created some simple DHTML code, but it isn't working, and you haven't been able to figure out what's wrong. If you're surfing a page using Internet Explorer, you get a little yellow warning icon which, when you click on it, provides you with a simple analysis of what's wrong, and the line number at which your script breaks down. The problem with this; is that it's not always where the real problem lies (as anybody who has used this to debug their code more than a couple of times will know). While the code may fail at the point that Internet Explorer indicates, the real problem - a misnamed variable, an incorrect value being passed along, or something else - could just as well lie elsewhere, and probably is. This is where Venkman shines.
Using this you can change the state of the objects on this page for testing purposes. For example, if you wanted to play a somewhat mean trick on the browser, you can type in Navigator.appName = "Internet Explorer". You may get an error message at this point. If not, try typing in Internet Explorer and you will see that the browser dutifully reports back that it is no longer Mozilla but Internet Explorer. If you are looking at a page that does not actively use Navigator.appName = "Internet Explorer" you can expect an error message in your Interactive Session window, saying essentially that it is not accessible in this case. From this simple demonstration, you can get an idea as to the power behind Venkman and how it can be used.
Figure 1: Accessing the Navigator.appName value within a page in Venkman
Your Code Step by Step
Figure 2: Stepping Through Halted Code in Venkman
Created: March 27, 2003
Revised: October 31, 2003