Skip to content

Instantly share code, notes, and snippets.

@danshearmur
Last active October 10, 2015 07:18
Show Gist options
  • Save danshearmur/3653869 to your computer and use it in GitHub Desktop.
Save danshearmur/3653869 to your computer and use it in GitHub Desktop.
Conditionally load zepto or jQuery with yepnope
var zep = "__proto__" in window;
yepnope([{
test: zep,
yep: '/static/js/zepto.js',
nope: '//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js',
complete: function () {
!zep && !window.jQuery && yepnope('/static/js/jquery-1.8.1.min.js');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment