Skip to content

Instantly share code, notes, and snippets.

@cking
Last active December 15, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cking/5304308 to your computer and use it in GitHub Desktop.
Save cking/5304308 to your computer and use it in GitHub Desktop.
(function() {
function getScript(url) {
var script = document.createElement('script');
script.src = url;
var head = document.getElementsByTagName('head')[0], done = false;
script.onload = script.onreadystatechange = function() {
if ( !done && (!this.readyState
|| this.readyState == 'loaded'
|| this.readyState == 'complete') ) {
done=true;
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
head.appendChild(script);
}
if(typeof window.Zepto == 'undefined') getScript('https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js');
if(typeof window._ == 'undefined') getScript('https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.min.js');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment