473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

preventing an event handler attached by attachEvent getting executed

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 <atag. I will then go on attaching function
f2() to onclick of the same <atag. Is there some thing in "f1()"
that can prevent f2() from getting executed ?

Thanks in Advance
Kiran.

Sep 27 '07 #1
3 2327
On 27 Sep, 15:31, wolverine <kiran.ha...@gmail.comwrote:
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 <atag. I will then go on attaching function
f2() to onclick of the same <atag. 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

Sep 27 '07 #2
On Sep 27, 10:31 am, wolverine <kiran.ha...@gmail.comwrote:
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 <atag. I will then go on attaching function
f2() to onclick of the same <atag. Is there some thing in "f1()"
that can prevent f2() from getting executed ?
Not that I know of.

Sep 27 '07 #3
On Sep 27, 8:53 pm, GArlington <garling...@tiscali.co.ukwrote:
On 27 Sep, 15:31, wolverine <kiran.ha...@gmail.comwrote:
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 <atag. I will then go on attaching function
f2() to onclick of the same <atag. 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.
Sep 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Fred Basset | last post by:
I am modifying existing code to add modal functionality to an IE5+ ActiveX Web-App. What I am trying to achieve is simple modal behaviour on popup windows, apart from certain specified ones. I...
6
by: Amir Hardon | last post by:
I am dynamically adding rows to a table, and each row have a button which removes it. I have successfully implemented this for mozilla but I'm having troubles with IE, here is how I did it: ...
4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
1
by: Peter Michaux | last post by:
Hi, It seems there is a long standing belief that in IE does not pass the event object to the handler functions attached with attachevent() to a DOM element. Coincidently, I was confused about a...
4
by: eggie5 | last post by:
I have this even handler (using prototype.js): showCommentsLinks.observe('click', function(event) { alert('hi') }); It's attaching to a link element: <a id="showCommentsLink"...
1
by: jayturley | last post by:
I have a web page with the following items on it: <label for="commissionschedule"> Commission Schedule<br /> <span id="charCounter">1000 characters or less</span> </label> <textarea...
4
by: yumbelie | last post by:
Hi, I've got an issue where I've created a prototype that contains 2 methods, and a few private variables. The first method simply registers the second method to be an event handler for the...
2
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.