Skip to content

Instantly share code, notes, and snippets.

@IlanFrumer
Last active December 14, 2015 05:49
Show Gist options
  • Save IlanFrumer/5038300 to your computer and use it in GitHub Desktop.
Save IlanFrumer/5038300 to your computer and use it in GitHub Desktop.
Append needed script tags to documents
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