Skip to content

Instantly share code, notes, and snippets.

@joeyhoer
Created May 2, 2013 03:06
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 joeyhoer/5499908 to your computer and use it in GitHub Desktop.
Save joeyhoer/5499908 to your computer and use it in GitHub Desktop.
Load either Zepto or jQuery, as necessary, from a CDN with a local fallback. For use with ZURB Foundation 4.
<script>
document.write('<script src=//cdnjs.cloudflare.com/ajax/libs/' +
('__proto__' in {} ?
'zepto/1.0/zepto.min' :
'jquery/1.9.1/jquery.min')
+ '.js><\/script>')
</script>
<script>window.$ || document.write('<script src=/js/vendor/' +
('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>')
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment