$(document).ready equivalent without jQuery
There is a standards based replacement,DOMContentLoaded that is supported by over 99% of browsers, though not IE8: document.addEventListener(“DOMContentLoaded”, function(event) { //do work }); jQuery’s native function is much more complicated than just window.onload, as depicted below. function bindReady(){ if ( readyBound ) return; readyBound = true; // Mozilla, Opera and webkit nightlies currently support this … Read more