Created
September 28, 2018 18:17
-
-
Save simshaun/c982001e4ac5f1d4aa5fe6dbe3d14a57 to your computer and use it in GitHub Desktop.
IE11 devtools - add/reload a stylesheet
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 existingLink = document.querySelector('link[data-custom-css]'); | |
if (existingLink) { existingLink.parentNode.removeChild(existingLink); } | |
var link = document.createElement('link'); | |
link.setAttribute('data-custom-css', '1'); | |
link.rel = 'stylesheet'; | |
link.href = '/xxxxxxxxxxxxxxxxxxxxxxxx.css?'+Math.floor(Math.random()*10000); | |
document.querySelector('head').appendChild(link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment