Created
November 6, 2017 06:57
-
-
Save hwshim0810/d9516942f7e779246756f63de2126e54 to your computer and use it in GitHub Desktop.
Dynamic favicon using javascript
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
(function() { | |
var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); | |
link.type = 'image/x-icon'; | |
link.rel = 'shortcut icon'; | |
link.href = 'http://www.stackoverflow.com/favicon.ico'; | |
document.getElementsByTagName('head')[0].appendChild(link); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment