By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

non bubling events

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Brian Genisio wrote:

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?


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/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.