preventing an event handler attached by attachEvent getting executed

Discussion in 'Javascript' started by wolverine, Sep 27, 2007.

  1. wolverine

    wolverine Guest

    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.
    wolverine, Sep 27, 2007
    #1
    1. Advertising

  2. wolverine

    GArlington Guest

    On 27 Sep, 15:31, wolverine <> wrote:
    > 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
    GArlington, Sep 27, 2007
    #2
    1. Advertising

  3. wolverine

    David Mark Guest

    On Sep 27, 10:31 am, wolverine <> wrote:
    > 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.
    David Mark, Sep 27, 2007
    #3
  4. wolverine

    wolverine Guest

    On Sep 27, 8:53 pm, GArlington <> wrote:
    > On 27 Sep, 15:31, wolverine <> wrote:
    >
    > > 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?

    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.
    wolverine, Sep 28, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    687
    Damien
    Feb 22, 2007
  2. Tony Johansson
    Replies:
    1
    Views:
    307
    Martin Honnen
    Dec 7, 2009
  3. wolverine
    Replies:
    0
    Views:
    101
    wolverine
    Sep 27, 2007
  4. wolverine
    Replies:
    2
    Views:
    150
    wolverine
    Nov 20, 2008
  5. Erwin Moller
    Replies:
    13
    Views:
    225
    Eric Bednarz
    Jul 26, 2009
Loading...

Share This Page