Mozilla provides an (undocumented) event tailor-made for this: DOMContentLoaded.
IE supports a very handy
defer. The presence of this attribute will instruct IE to defer the loading of a script until after the DOM has loaded. This only works for external scripts however. Another important thing to note is that this attribute cannot be set using script.