If you add an onclick listener to an anchor with addEventListener, the return value is ignored and whatever is in the href is activated.
I come across this issue every day and have written about it before, but its only after coming out the other end of writing my addEventListener wrapper/replacement that I really appreciate just how mind bogglingly out of place this behavior is.
If this was a natural phenomena, creationists would simply have to throw their hands in the air and acknowledege that there was obviously nobody at the wheel.
Did you try event.preventDefault() ? That seems to be the proper way in the W3C DOM Level 2 Events model to cancel the default action associated with an event. It works great for me on Gecko.
Example :
handleEvent(evt)
{
if (foo) bar();
else evt.preventDefault();
}
Ref:
http://developer.mozilla.org/en/docs/DOM:event.preventDefault
http://news.hping.org/comp.lang.javascript.archive/5339.html