Last active
March 11, 2023 21:38
-
-
Save cvan/8a188df72a95a35888b70e5fda80450d to your computer and use it in GitHub Desktop.
check if a CSS stylesheet has 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
var linkEl = document.head.querySelector('link[href*="/styles/index.css"]'); | |
var cssLoaded = Boolean(linkEl.sheet); | |
linkEl.addEventListener('load', function () { | |
cssLoaded = true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if(document.head.querySelector('link[href*="/index.css"]') != null)