PDA

View Full Version : attachEvent Help Please


SYP}{ER
02-02-2003, 01:09 AM
I can use attachEvent, but how would I go about checking to see if the event hasn't already been attached?

ex:

if (!eventAttached ('onmouseover')) attachEvent ('onmouseover', alert);

Now I highly doubt that "eventAttached" is a method, but what could I use?

Thanks :D

jkd
02-02-2003, 02:06 AM
You can't. And please tell me that you're also using the W3C DOM2 Events method, addEventListener() for compliant browsers... :)

SYP}{ER
02-02-2003, 02:32 AM
Naw, for Moz I'm using setAttribute.

jkd
02-02-2003, 02:49 AM
Then why not use setAttribute() to set it in IE as well, and getAttribute() to check if it is set?

SYP}{ER
02-02-2003, 12:08 PM
Because for some reason it wasn't working. I use set and get for Moz and it works (sort of...)