Compensating with Firebug
Firebug is one of those rare tools that so fundamentally changes the way you do something (in this case web development, especially javascript) that, once you get used to it, you can’t quite remember what life was like without it.
As a quick example, today I found myself faced with the necessity of doing some batch operations in Drupal and cursing the lack of a “check all” option on the content edit screen. I could have figured out how to write a php script to do what I want or wrangle the database directly — and risk missing something. Instead, I fired up the Firbug console, and just ran this on the few pages I needed to “check all” on to run my batch operations right from the UI:
var checks = document.getElementsByTagName('input');
for(c in checks) {
checks[c].checked = true;
}
I wouldn’t recommend this as a production solution — it checks every checkbox on the page and doesn’t discriminate between input elements (i.e., it sets “checked” attributes on every input) — but worked great for my case. It would have been even simpler if I’d had jQuery available. But that’s another post.
