Created
August 22, 2015 17:26
-
-
Save delameko/5aad8eaced9671617480 to your computer and use it in GitHub Desktop.
Check that the page has finished loading
This file contains hidden or 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
// The basic check | |
if(document.readyState === 'complete') { | |
// good to go! | |
} | |
// Polling for the sake of my intern tests | |
var interval = setInterval(function() { | |
if(document.readyState === 'complete') { | |
clearInterval(interval); | |
done(); | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment