Skip to content

Instantly share code, notes, and snippets.

@Nyalab
Created April 23, 2014 08:32
Show Gist options
  • Save Nyalab/11207136 to your computer and use it in GitHub Desktop.
Save Nyalab/11207136 to your computer and use it in GitHub Desktop.
domready.js
var domReadyRE = /interactive|complete|loaded/
, isReady = false
function checkStatus() {
if(isReady) return
if(domReadyRE.test(document.readyState)) {
isReady = true
ready()
return
}
setTimeout(checkStatus, 10)
}
checkStatus();
function ready() {
// here goes your shitty code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment