Created
June 2, 2016 12:42
-
-
Save bantya/a03304165433f1eb119d3a3ae12a8720 to your computer and use it in GitHub Desktop.
js: attach dynamic css file using javascript.
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
var filename='http://path/to/your/cssfile.css?' + new Date().getTime(); | |
var fileref=document.createElement("link"); | |
fileref.setAttribute("rel", "stylesheet"); | |
fileref.setAttribute("type", "text/css"); | |
fileref.setAttribute("href", filename); | |
document.getElementsByTagName("head")[0].appendChild(fileref); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment