What is the non-jQuery equivalent of ‘$(document).ready()’?
This works perfectly, from ECMA. The snippet is all you need, but if you want to dig more and explore other options check this detailed explanation. The window.onload doesn’t equal to JQuery $(document).ready because $(document).ready waits only to the DOM tree while window.onload check all elements including external assets and images. EDIT: Added IE8 and older equivalent, thanks to Jan Derk‘s observation. You may read … Read more