Hi there,
Events can be attached multiple times to the same element.. is there a
way to prevent this?
Something like ...
if(!$(el).hasEventAttached()) Event.observe($(el), 'click',
function());
... would be great
Any way to achieve this?
Roland,
On 9/14/07, Roland [EMAIL PROTECTED] wrote:
Events can be attached multiple times to the same element..
No, they can't. The addEventListener method doesn't attach a handler more
than once; and as for IE, Prototype 1.6 avoids attaching the same handler
twice. So, in IE we emulate
On Sep 14, 2007, at 1:08 AM, Roland wrote:
Hi there,
Events can be attached multiple times to the same element.. is there a
way to prevent this?
Something like ...
if(!$(el).hasEventAttached()) Event.observe($(el), 'click',
function());
If this is what you *really* need (and I'd
Wow I hate the attribute model, so broken heh.
What is wrong with the native getAttribute method, is there anything
different going on here?
Cheers,
Matt
On Sep 13, 3:02 pm, Yanick [EMAIL PROTECTED] wrote:
I don't know if anyone has encountered this problem before, but I was
reading
The values returned by getAttribute are not always the same across different
browsers.
Element#readAttribute simply wraps getAttribute and returns consistently.
If you read through the Prototype source, you can see the differences that
it resolves.
- Skip
On 9/14/07, Matt Foster [EMAIL