Last active
December 14, 2015 05:49
-
-
Save IlanFrumer/5038300 to your computer and use it in GitHub Desktop.
Append needed script tags to documents
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
defaultSource = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; | |
// just uncomment the library that you need ( and keep the others commented ) | |
// scriptSource = '//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js'; | |
// scriptSource = '//cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.3/angular.min.js'; | |
// scriptSource = '//cdn.jsdelivr.net/sugar/1.3.9/sugar.min.js'; | |
// scriptSource = '//cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js'; | |
var script = document.createElement('script'); | |
script.src = typeof scriptSource !== 'undefined' ? scriptSource : defaultSource; | |
document.head.appendChild(script); | |
// CDN : | |
// | |
// http://cdnjs.com/ | |
// http://www.jsdelivr.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment