Created
September 7, 2015 22:00
-
-
Save prokizzle/e66e576af2b0f1378631 to your computer and use it in GitHub Desktop.
Javascript External CSS Injector
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 Inject = { | |
externalCSS: function(href) { | |
var css = document.createElement('link'); | |
css.href = href; | |
css.type = 'text/css'; | |
css.rel = 'stylesheet'; | |
var head = document.getElementsByTagName('head')[0]; | |
head.appendChild(css); | |
}, | |
fontAwesome: function(){ | |
this.externalCSS("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"); | |
} | |
} | |
Inject.fontAwesome(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment