Skip to content

Instantly share code, notes, and snippets.

@dandelionmood
Created October 4, 2012 19:23
Show Gist options
  • Save dandelionmood/3835821 to your computer and use it in GitHub Desktop.
Save dandelionmood/3835821 to your computer and use it in GitHub Desktop.
Document Ready cross-browser
function docReady() {
alert('ok');
}
if (typeof window.addEventListener === 'function') {
window.addEventListener('DOMContentLoaded', docReady, false);
} else {
window.onload = function() { docReady(); };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment