Skip to content

Instantly share code, notes, and snippets.

@edgarberm
Created August 24, 2015 12:28
Show Gist options
  • Save edgarberm/f0a1917bd730340baad7 to your computer and use it in GitHub Desktop.
Save edgarberm/f0a1917bd730340baad7 to your computer and use it in GitHub Desktop.
Check if everything has fully loaded in our document
var everythingIsLoaded = setInterval( function () {
if ( /loaded|complete/.test( document.readyState ) ) {
clearInterval( everythingIsLoaded );
// Initialize our code..
}
}, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment