Changing the window scope in Firebug
If I had to choose one piece of advice for new web developers, I’d tell them to learn to use Firebug. Firebug is probably the most valuable debugging tool available, but if you are just getting started, it may seem pretty opaque at first.
In addition, some things do not appear to work as advertised. In particular, the “cd” function does nothing as far as I can tell.
The page that documents the commands you can use within Firebug lists the cd command as a way of changing the window scope:
Let’s say you want to test for the existence of something (a function, property, etc.) within a page. If you are working with a single window, you would simply type the name of the property into the command line and firebug returns the current value of that property, or “null” or “undefined”.
But what if the property you want to examine resides within a window that is inside a frame? You need to change the scope that is being addressed so that your expression is evaluated within the correct frame.
You are supposed to be able to type “cd(frameName)” or “cd(top)” to change the window scope of the succeeding commands. Yet, I’ve tried just about every possible way of addressing windows and frames with it, and it never seems to work. It always returns “null”.
However there are other ways to get almost the same results.
If you are not certain exactly what you are looking for, you can just type:
values(frameName); into the command line box
And if you simply enter “frames” you will get a navigable DOM listing of everything within that frame similar to the listing in the DOM tab.
To inspect a specific property of frames, type