ChatGPT解决这个技术问题 Extra ChatGPT

backbone.js & underscore.js CDN recommendation?

Is there any CDN sources for backbone.js and also underscore.js to use in our projects?


j
jpaugh

http://www.cdnjs.com hosts a lot of less popular JavaScript frameworks, including:

backbone.js: //cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js (HTTP | HTTPS)

underscore.js: //cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js (HTTP | HTTPS)

For convenience, here are the script tags:

<script type="text/javascript"
   src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script
   src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>

how much trusted it is for prod environments..?
digg.com uses cdnjs. Check out some more cdnjs stats and users: w3techs.com/technologies/details/cd-cdnjs/all/all
Less popular? I've heard there are some people who use backbone and underscore.
@ericsoco I think he means "less popular than jQuery"
Tbh cloudflare seems to have its periods of down time atleast in europe
M
Mite Mitreski

http://www.jsdelivr.com/ is also a good alternative for less popular frameworks

backbone.js: //cdn.jsdelivr.net/backbonejs/0.9.10/backbone-min.js

underscore.js: //cdn.jsdelivr.net/underscorejs/1.4.3/underscore-min.js

Also in most cases it is a good idea to omit the protocol in the URL for JavaScript source.

More on http://www.paulirish.com/2010/the-protocol-relative-url/


Why omit the protocol again?
@Bepetersn it will work on HTTP and HTTPS site. Basically the newer browser will not include non HTTPS content on an HTTPS page, this simplifies the job, but does not work on IE6 I think
NB: though according to best practices the protocol should be omitted, this can cause issues (not just browser support); e.g. twitter.com/mindmillmedia/status/402550801328922625.
jsdelivr is the worst cdn ever, do not use in production, you have been warned
@Pykler Can you tell me why? In asia/pacific, jsDeliver is the fastest public cdn.