Skip to content

Instantly share code, notes, and snippets.

@elijahr
Created March 22, 2012 17:10
Show Gist options
  • Save elijahr/2159899 to your computer and use it in GitHub Desktop.
Save elijahr/2159899 to your computer and use it in GitHub Desktop.
basic DOM ready handling, sans jQuery
function init(){
// do some stuff to the DOM
}
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', init, false);
} else {
window.onload = init;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment