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