Connecting Tech Pros Worldwide Help | Site Map

non bubling events

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 02:30 PM
Brian Genisio
Guest
 
Posts: n/a
Default non bubling events

Hello all,

In IE, when an event occurs, as long as it returns true, and
cancelBubble is not set, the event will bubble up through the elements
in the DOM tree.

Though, there is at least one event that does not bubble... the onLoad
event.

For instance:
<BODY onLoad="alert('body onload')">
<IMG src=img.gif onLoad="alert('img onload');">
<SCRIPT>alert("TEST");</SCRIPT>
</BODY>

will show : "img onload", "test", "body onload".

This prooves that the onLoad event did not bubble, even if true is
returned and cancelBubble == false.

Of course, this makes sense. Just because the image has loaded, does
not mean that entire page has loaded.

So, here is my question:
In what other cases are events not bubbled? Is there a pattern? Or is
this the only case?

Thanks,
Brian


  #2  
Old July 20th, 2005, 02:30 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: non bubling events



Brian Genisio wrote:

[color=blue]
> In IE, when an event occurs, as long as it returns true, and
> cancelBubble is not set, the event will bubble up through the elements
> in the DOM tree.
>
> Though, there is at least one event that does not bubble... the onLoad
> event.
>
> For instance:
> <BODY onLoad="alert('body onload')">
> <IMG src=img.gif onLoad="alert('img onload');">
> <SCRIPT>alert("TEST");</SCRIPT>
> </BODY>
>
> will show : "img onload", "test", "body onload".
>
> This prooves that the onLoad event did not bubble, even if true is
> returned and cancelBubble == false.
>
> Of course, this makes sense. Just because the image has loaded, does
> not mean that entire page has loaded.
>
> So, here is my question:
> In what other cases are events not bubbled? Is there a pattern? Or is
> this the only case?[/color]

For IE, check the docs at
http://msdn.microsoft.com/library/de...nce/events.asp
they tell you which events bubble.

For DOM compliant browsers, check the W3C DOM Events specification at
http://www.w3.org/DOM/, it also lists which events bubble.
--

Martin Honnen
http://JavaScript.FAQTs.com/

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.