[thelist] javascript default event handlers, default events. [TIP]

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Tue Aug 30 13:49:27 CDT 2005


Thanks Jeff,

I know those methods but I use them rarely. 
Most of the time foo.onclick=function(){dostuff and return false}; was
enough and worked pretty well for me.

My confusion -or me not being "concise" as you name it- was my
misbelief that returning false should be adequate to prevent the
default action from happening.

x.onclick=function(){return false;};

does exactly that in mozilla/ie/opera etc --as you have mentioned
also-- which had made my misbelief stronger.

So strong that even seeing a "return false" not stopping the default
event handler which has been added via addEventListener did not arise
any suspicion in me.

Thank you for sparing your time, sharing your experiments and  findings.

I'll go through the references you supplied as well. Errrm, not sure
about the third one :)

Cheers,
Volkan.


More information about the thelist mailing list