Created
November 24, 2014 02:22
-
-
Save elyalvarado/fbb15fe86fba6c8fbcb6 to your computer and use it in GitHub Desktop.
Inject javascript and css for c3 and d3 from the console
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 javascriptLibraries = [ | |
"//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js", | |
"//cdnjs.cloudflare.com/ajax/libs/c3/0.4.4/c3.min.js" | |
]; | |
var stylesheetLibraries = [ | |
"//cdnjs.cloudflare.com/ajax/libs/c3/0.4.4/c3.min.css" | |
]; | |
for (var i = 0; i < javascriptLibraries.length; i++) { | |
var _me = document.createElement('script'); _me.type = 'text/javascript'; _me.async = false; | |
_me.src = javascriptLibraries[i]; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(_me, s); | |
} | |
for (var i = 0; i < stylesheetLibraries.length; i++) { | |
var _me = document.createElement('link'); _me.rel = 'stylesheet'; | |
_me.href = stylesheetLibraries[i]; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(_me, s); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment