Webby thoughts, most about around interesting applications of ecmascript in relation to other open web standards. I live in Mountain View, California, and spend some of my spare time co-maintaining Greasemonkey together with Anthony Lieuallen.

2008-01-14

When working in the Firebug console, you might have noticed that syntax errors and the like show up in red on executing the command line. Great success! Exceptions thrown by the DOM, however, for some reason don't, so there is no telling whether your document.getElementById() call happily returned undefined or threw an exception on you.

If you go to about:config and type firebug.showChromeErrors into the Filter: field, and double-click that line to read true -- presto! You can suddenly see where you and the DOM disagree, and when you made some XPath syntax error, so you can tell apart cases like $X('//div[@class="post"') and $X('//div[@class="post"]') and the like.

I've filed a ticket on this weird default behaviour, but am glad I finally found this trivial cure. (I really don't want to know how many times I've wrapped a statement on the command line into a try{ ... }catch(e){e} block to figure out just if or what went wrong.)

When working in the Firebug console, you might have noticed that syntax errors and the like show up in red on executing the command line. Great success! Exceptions thrown by the DOM, however, for some reason don't, so there is no telling whether your document.getElementById() call happily returned undefined or threw an exception on you.

If you go to about:config and type firebug.showChromeErrors into the Filter: field, and double-click that line to read true -- presto! You can suddenly see where you and the DOM disagree, and when you made some XPath syntax error, so you can tell apart cases like $X('//div[@class="post"') and $X('//div[@class="post"]') and the like.

I've filed a ticket on this weird default behaviour, but am glad I finally found this trivial cure. (I really don't want to know how many times I've wrapped a statement on the command line into a try{ ... }catch(e){e} block to figure out just if or what went wrong.)