M
Matt Kruse
There is a discussion going on in the jquery-dev mailing list that
piqued my curiosity. I'm interested to know if the smart people here
have a good answer.
Is there a cross-browser way, in script, to determine if window.onload
has already fired?
If a script is lazy loaded and needs the DOM to be ready, it can
attach to the window's load event. But if that has already fired, then
the script's code will never run. Alternatively, it can just fire its
code inline, but the DOM may not be ready.
Thoughts?
Matt Kruse
piqued my curiosity. I'm interested to know if the smart people here
have a good answer.
Is there a cross-browser way, in script, to determine if window.onload
has already fired?
If a script is lazy loaded and needs the DOM to be ready, it can
attach to the window's load event. But if that has already fired, then
the script's code will never run. Alternatively, it can just fire its
code inline, but the DOM may not be ready.
Thoughts?
Matt Kruse