2006-03-20

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 comments:

  1. 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.

    ReplyDelete
  2. 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.

    ReplyDelete

Limited HTML (such as <b>, <i>, <a>) is supported. (All comments are moderated by me amd rel=nofollow gets added to links -- to deter and weed out monetized spam.)

I would prefer not to have to do this as much as you do. Comments straying too far off the post topic often lost due to attention dilution.

Note: Only a member of this blog may post a comment.