preventing an event handler attached by attachEvent getting executed

W

wolverine

Hi,
I am injecting a javascript code into html pages and attaching
some dom events to some elements via attachEvent (IE only). I just
want to know that is there any chance by which my event handler not
getting executed ? ie, is there some means for the web developer to
prevent any further handler getting executed for the same event on the
same element ?

To be more clear, assume the web developer has attached function
"f1()" on onclick of <a> tag. I will then go on attaching function
f2() to onclick of the same <a> tag. Is there some thing in "f1()"
that can prevent f2() from getting executed ?

Thanks in Advance
Kiran.
 
G

GArlington

Hi,
I am injecting a javascript code into html pages and attaching
some dom events to some elements via attachEvent (IE only). I just
want to know that is there any chance by which my event handler not
getting executed ? ie, is there some means for the web developer to
prevent any further handler getting executed for the same event on the
same element ?

To be more clear, assume the web developer has attached function
"f1()" on onclick of <a> tag. I will then go on attaching function
f2() to onclick of the same <a> tag. Is there some thing in "f1()"
that can prevent f2() from getting executed ?

Thanks in Advance
Kiran.

1) Are you sure that BOTH event listeners are registered?
2) Try to see if the following will help
http://www.quirksmode.org/js/events_advanced.html
 
D

David Mark

Hi,
I am injecting a javascript code into html pages and attaching
some dom events to some elements via attachEvent (IE only). I just
want to know that is there any chance by which my event handler not
getting executed ? ie, is there some means for the web developer to
prevent any further handler getting executed for the same event on the
same element ?

To be more clear, assume the web developer has attached function
"f1()" on onclick of <a> tag. I will then go on attaching function
f2() to onclick of the same <a> tag. Is there some thing in "f1()"
that can prevent f2() from getting executed ?

Not that I know of.
 
W

wolverine

1) Are you sure that BOTH event listeners are registered?
Yeah both f1() and f2() are registered. Let me make my question more
clear. Assume i have attached an event handler by attachEvent. I am
asking is there anything that can prevent my event handler getting
called, unless i call a detachEvent to remove my handler.
2) Try to see if the following will helphttp://www.quirksmode.org/js/events_advanced.html
Thanks for the link. It helped me understand some concepts on events
handling. But that didn't answer my question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top