473,666 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2355
On 27 Sep, 15:31, wolverine <kiran.ha...@gm ail.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...@gm ail.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...@tis cali.co.ukwrote :
On 27 Sep, 15:31, wolverine <kiran.ha...@gm ail.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
5848
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 initially attempted to use a direct assignment to the onblur handler of the new window, but for some reason couldn't get it to work, so I've instead used attachEvent. This provides simple modal functionality. The problem that I need help with is...
6
2326
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: Each new row's id is an index number, each button's name is the row's id, and I'm adding this function as the click event listener for the button: function removeline(event){ var row=document.getElementById("row" + event.target.name);
4
4906
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'); window.resizeTo(810,750); top.outerWidth=810;
1
1264
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 week ago by the fact that an event object is, in fact, passed to the handler but I didn't investigate this further. Now David Flanagan is organizing and effort to figure out what is going on and where this belief came from. Perhaps someone here...
4
2136
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" href="comments/">Show Comments</a>
1
4393
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 id="commissionschedule" rows="10" cols="40"></textarea> I'm using a standard javascript addEvent function and am attaching a keyup event to the textarea as follows:
4
1686
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 mousedown event. This prototype is instanced for each instance of a server control. Basically it's an asp panel and for each one on the aspx webpage, an instance of my JavaScript prototype is created. Okay, so, when the prototype is instanced ( var...
2
3240
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 that procedure in the code that I attached to a button click. Here is the event handler code which is created automatically: this.AddCustomer.Click += new System.EventHandler(this.AddCustomer_Click); I checked the stored procedure and the code...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.