Firebug can make life easier
by Pascal Opitz on June 28 2007, 11:06
The highlight here is the
console.log() function for debugging. This first of all gets rid of all those alerts that pause the application till we click the button of the alert box.
When we pass a dom node to
console.log() instead of a string, we’ll have the dom node in the console, that on rollover highlights it’s position on the page.
Amazing is that this is even possible with an array of nodes, i.e. out of
getElementsByTagName() or something similar.
The output will be a nice little list of nodes that on rollover can be identified in the browser window.
console.dir() gives an even more detailed view on the object, with properties and so on, vaguely similar to a print_r or vardump in PHP, just that the console lets you collapse the single nodes etc.
Thanks for the tip Pete!