Skip to content

Instantly share code, notes, and snippets.

@ahmednuaman
Created March 8, 2011 16:52
Show Gist options
  • Save ahmednuaman/860531 to your computer and use it in GitHub Desktop.
Save ahmednuaman/860531 to your computer and use it in GitHub Desktop.
Using document.readyState to see if the DOM is ready
var timer = setInterval( function()
{
if ( /loaded|complete/.test( document.readyState ) )
{
clearInterval( timer );
// go!
}
}, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment