4 ms·
You're looking for Bower: http://bower.io http://bower.io For single-file libs like jQuery, you should look at using a CDN. I believe Google's jQuery CDN is th
by smt88 12y ago
You're looking for Bower: http://bower.io http://bower.io
For single-file libs like jQuery, you should look at using a CDN. I believe Google's jQuery CDN is the fastest. There's no need to host it yourself.
Semi-related: having both jQuery and Prototype on a single page is going to hurt load times. See if you can replace all your Prototype stuff with jQuery.
(Just out of curiosity, why exactly are you using Prototype at all?)
- kekebo 12y agoPerfect! Considering loading scripts from CDN: I just like to keep as much as possible locally and minimizing having to rely on things I have no control over (I've noticed Google Fonts taking up to almost a second in a few rare cases). As for why I'm (still) using prototype: I'm taking over a (mediocrely designed) magento shop, which has prototype as a standard dependency (apparently for ECMA5 support).
- smt88 12y agoWhen you use a CDN, you can use a local fallback. Note that very old/shitty browsers won't support scheme-less URLs or jQuery 2.x, although those options are more modern and preferable. You just have to make the decision based on your users. Here's example code for local jQuery fallback: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/jquery-2.1.3.min.js">\x3C/script>')</script> You can also use yepnope, but I don't use that personally.