Created
August 7, 2020 20:30
-
-
Save colinlord/89e5c041290f8d48c9395758ef5950fe to your computer and use it in GitHub Desktop.
Fire JS after page is totally loaded
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
document.addEventListener("readystatechange", function () { | |
switch (document.readyState) { | |
case "complete": | |
{ | |
// put your code here that will run after the page loads completely. | |
// if there is "flashing" and complaints are raised you can choose an earlier readyState | |
// always use "complete" if loading external resources | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment