Re: DOMContentLoaded event and iframes
WakA <p.c.spruijtenburg@_riimove_student.utwente.nl>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <2010012421524516807-pcspruijtenburg@riimovestudentutwentenl> |
On 2010-01-24 20:38:34 +0100, Boris Zbarsky <[email protected]> said: > On 1/24/10 2:05 PM, WakA wrote: >> I've noticed that the DOMContentLoaded event also fires for iframes >> embedded inside a document. Is it possible to ignore or incorporate the >> DOM of these iframes so the event fires only if the "top" document's DOM >> is loaded or only if all DOM content including that of the iframes is >> loaded? > > Possible in what sense? The web depends on current DOMContentLoaded > behavior, so it's not exactly subject to change in a shipping browser > that needs to browse the web, but if you're doing something custom you > can change it, of course.... > > -Boris Naturally, I'm not expecting or even hoping for a change in the codebase or behavior in order to achieve this. If I wanted to fry an egg using my browser i'm sure this would be "possible" in some way. ;) I was mostly looking to DOMContentLoaded as a way to supplant a load event (that only fires after all the potentially big content has been loaded). My expectation for the behavior of DOMContentLoaded was thus of a load event minus all the nonDOM content, but this turned out not to be since the "whole" page is not fully loaded and waiting for iframes to load whilst the DOMContentLoaded event is already fired. Ideally I guess I'm looking for something like a (theoretical) DOMAllContentLoaded event. Unfortunately we don't live in a theoretical world and I'm not sure of the benefit of such an event for most users anyway as my knowledge of this field is sadly limited. Anyway, if there is a way to achieve this without keeping track of DOM myself I would love to hear about it. Chris