ecmanaut

The author

2006-03-21, 02:50

FireBug tip: $1

Since my recent briefing about FireBug, I have been in touch with Joe Hewitt (the extension author) and found out the missing link I had not found out about how to use its Inspect feature via the console. Once you pick a node, it becomes available as $1 from the console, so if you want to register an event handler on something in a page to try out something, you could run $1.addEventHandler(...). Or replace or otherwise process its innerHTML, and so on. Useful.

And it gets better.

2 Comment:

  • Yeah, quite useful. Joe told me this as well.

    Later, I took a quick look in his code, and find some other goodies, such as $ function used as a shortcut for document.getElementById (like in Prototype) and dir(element) function which lists all attributes of an object.

    By Blogger splintor, on Tue Mar 21, 09:27:00 AM CET  

  • FYI, in the upcoming version 0.3 I I have changed $1 to be $0. Then there is $1 which references the second-most recently inspected object, and $n(2) which returns the nth most recently inspected object.

    By Anonymous Joe Hewitt, on Tue Mar 28, 10:17:00 AM CEST  

Post a Comment

http://ecmanaut.blogspot.com/2006/03/firebug-tip-1.html