Created
September 8, 2013 17:35
-
-
Save mojaray2k/6486769 to your computer and use it in GitHub Desktop.
You can use the vanilla Javascript Dom Ready event without jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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