Post by Boris ZbarskyPost by WakAI'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