Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created September 8, 2013 17:35
Show Gist options
  • Save mojaray2k/6486769 to your computer and use it in GitHub Desktop.
Save mojaray2k/6486769 to your computer and use it in GitHub Desktop.
You can use the vanilla Javascript Dom Ready event without jQuery
//domready2.js
// without jQuery (doesn't work in older IEs)
document.addEventListener('DOMContentLoaded', function(){
// your code goes here
}, false);
// and here's the trick (works everywhere):
r(function(){
alert('DOM Ready!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment