Skip to content

Instantly share code, notes, and snippets.

@jeroenbourgois
Created October 8, 2012 14:32
Show Gist options
  • Save jeroenbourgois/3852821 to your computer and use it in GitHub Desktop.
Save jeroenbourgois/3852821 to your computer and use it in GitHub Desktop.
function documentReady(readyFunction) {
// I added a check here to see if addEventListener
// is known, cause IE will fail and we can stop safely then
if(document.addEventListener) {
document.addEventListener('DOMContentLoaded', function() {
document.removeEventListener('DOMContentLoaded', arguments.callee, false);
readyFunction();
}, false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment