[thelist] Unobtrusive JavaScript & return false

Paul Bennett Paul.Bennett at wcc.govt.nz
Mon Jul 24 17:58:24 CDT 2006


>Hi Paul,

Hi again Matt :) Are you getting sick of me yet?

>First of all, there is an *excellent* discussion list specifically for
>the YUI library. You can find it on the YUI site:

Doh! Missed this when I went hunted on the YUI site - thanks for the link.
For those that are interested, the group is here:
http://groups.yahoo.com/group/ydn-javascript/

>I assume you are trying to stop the event. 
Correct

> return false is not the way to do this. 
Ahh.

>The reason it does not work in addListener is because
>addListener uses attachEvent or addEventListener if they are available
>in the browser. You want to take a look at preventDefault,
>stopPropagation, or stopEvent (which does both), depending on exactly
>what you're trying to do:

I'll look at preventDefault - I'm trying to stop the default behaviour of the browser activating the link, and instead open a new window at the same URL. I don't want to cancel the event entirely.

Thanks Matt



More information about the thelist mailing list