Created
March 8, 2011 16:52
-
-
Save ahmednuaman/860531 to your computer and use it in GitHub Desktop.
Using document.readyState to see if the DOM is ready
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
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