Skip to content

Instantly share code, notes, and snippets.

@rafagarcia
Forked from dciccale/README.md
Created November 28, 2012 08:29
Show Gist options
  • Save rafagarcia/4159877 to your computer and use it in GitHub Desktop.
Save rafagarcia/4159877 to your computer and use it in GitHub Desktop.
Tiny Cross-browser DOM ready function (120 bytes)
// @param {function} f The function to execute when DOM is ready
function a(f,o,m){o=document,m='addEventListener';o[m]?o[m]('DOMContentLoaded',f):(o=window,o.attachEvent('onload',f));}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment