Skip to content
Advertisement

What is the non-jQuery equivalent of ‘$(document).ready()’?

What is the non-jQuery equivalent of $(document).ready()?

Advertisement

Answer

This does not answer the question nor does it show any non-jQuery code. See @ sospedra’s answer below.

The nice thing about $(document).ready() is that it fires before window.onload. The load function waits until everything is loaded, including external assets and images. $(document).ready, however, fires when the DOM tree is complete and can be manipulated. If you want to acheive DOM ready, without jQuery, you might check into this library. Someone extracted just the ready part from jQuery. Its nice and small and you might find it useful:

domready at Google Code

Advertisement