Interesting new JavaScript trick from Hedger Wang: poll the doScroll() method of an unattached DOM element until it stops throwing errors, and when it does, the DOM’s loaded. This gives you the
equivalent of the DOMContentLoaded event for IE, and in a rather nicer
way than the current-best method of document.write
-ing a script
tag
with a defer
attribute. I like this a lot, although I’d like to see
some more detail about whether it works in all IEs before switching to it!
Alternative DOMContentLoaded for IE
I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing
and articles. You can take a look at some projects I've worked on and
some of my writing. If you'd like to talk about your upcoming project,
do get in touch.