Created
October 1, 2016 19:36
-
-
Save englishextra/d00e7046c9957199ff3e87af693f38be to your computer and use it in GitHub Desktop.
How can I check if a CSS file has been included already?
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
/*! | |
* How can I check if a CSS file has been included already? | |
* gist.github.com/englishextra/d00e7046c9957199ff3e87af693f38be | |
* stackoverflow.com/questions/18155347/how-can-i-check-if-a-js-file-has-been-included-already | |
* @param {String} h path string | |
* styleIsLoaded(h) | |
*/ | |
var styleIsLoaded=function(h){var a=document.styleSheets||"";if(a)for(var b=0,d=a.length;b<d;b++)if(a[b].href==h)return!0;return!1}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment