Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to check whether an event has been already handled in IE ?

Reply
Thread Tools

how to check whether an event has been already handled in IE ?

 
 
wolverine
Guest
Posts: n/a
 
      08-23-2007
Hi,
I am trying to find the events that occur from a javascript. But
in a page, onclick event is attached to both an <img> and <body> tags.
So if the user click on <img> the event first comes to "img" element
and then to "body" element . Is there any way in IE to find out the
event when event reaches <body> that it has already been handled by
<img> ?

Thanks in Advance
Kiran.

 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      08-23-2007
wolverine wrote:
> I am trying to find the events that occur from a javascript. But
> in a page, onclick event is attached to both an <img> and <body> tags.
> So if the user click on <img> the event first comes to "img" element
> and then to "body" element .


Not quite. The event first propagates down the document tree from the root
of the tree for it to be handled by any element that has a capturing event
listener attached for it. Then it bubbles back up from the deepest child
element to the root of the tree. On that upwards way it is handled by any
element that has a non-capturing event listener attached for it, provided
that it is not canceled before; in this case the `img' and the `body' element.

> Is there any way in IE to find out the event when event reaches <body>
> that it has already been handled by <img> ?


Yes, the respective event target property will tell. It's `srcElement' in
the MSHTML DOM (incl. IE), and `target' in standards (W3C) compliant DOMs.
See <. com> for more.


HTH

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Check if value has already been used Chris Gallagher Ruby 3 12-19-2007 03:27 PM
how to check whether an event has been already handled in IE ? wolverine Javascript 0 08-23-2007 05:48 AM
I need help I has been over 6 months since I've been able to do the system check for updates Marc Computer Support 8 07-25-2005 07:04 PM
Check whether a form has been modified JL Smith Javascript 0 07-30-2003 04:10 PM



Advertisments