Skip to content

Instantly share code, notes, and snippets.

@heyjohnmurray
Created October 8, 2015 15:59
Show Gist options
  • Save heyjohnmurray/1526d70f2da0dced6987 to your computer and use it in GitHub Desktop.
Save heyjohnmurray/1526d70f2da0dced6987 to your computer and use it in GitHub Desktop.
vanilla js version of $(document).ready();
var readyFunction = function () {
// begin to put your code here
}
if (document.readyState != 'loading') {
readyFunction();
}
else {
document.addEventListener('DOMContentLoaded', readyFunction)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment