[thelist] unobtrusive JS: adding events with parameters?

Tom Dell'Aringa pixelmech at yahoo.com
Thu Jan 12 09:53:25 CST 2006


----- Original Message ----
From: Christian Heilmann codepo8 at gmail.com
>
> I'm using Scott Andrew's faithful addEvent() method[1] to add an event to some images at load time. My init function has this clause:

The issue with scott andrew's addEvent is that it doesn't retain the
"this", that is why there was a code competition to replace it.

http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

As this one still has issues in Safari, I tend to use another method
to find the element that was activated called getTarget and one to
cancel any other functionality called cancelClick (the equivalent of
return false).

(code snipped)
 
Thanks Christian as usual. I'll give it a go. This is actually for a kiosk running on IE so I don't have to worry about Safari :)
 
Tom



More information about the thelist mailing list