zeptojs With jQuery Fallback

jQuery is great but big! Zepto is tiny 8.5k! but not IE compatible  This will test for IE and load the jQuery or Zepto though the CDN. If the CDN is down there is a local fallback

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.


document.write(‘<script src=’ +
(!+”v1″ ? ‘//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery’ :’//cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto’ ) +


<script>window.$ || document.write('<script src="/local/jquery-1.8.0.min.js"></script>')</script>


Leave a Reply

Your email address will not be published. Required fields are marked *