Created
May 16, 2020 10:45
-
-
Save mawiswiss/ebcce71a4f654cf1b197d5df95808963 to your computer and use it in GitHub Desktop.
load Event Listener
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
| function winLoad(callback) { | |
| if (document.readyState === 'complete') { | |
| callback(); | |
| } else { | |
| window.addEventListener("load", callback); | |
| } | |
| } | |
| winLoad(function() { | |
| console.log('Window is loaded'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment