Is there a public CDN that hosts JSON2?

It is well known that Google and Microsoft host several shared javascript libraries on their CDN (content distribution network). Unfortunately, none of them contain JSON2.js .

I know that I could upload a copy of JSON2.js to my server and serve it myself, but there are a number of advantages that CDN offers that I would like to use.

So, bearing in mind, are there any public CDNs that host JSON2? If not, why? Is there any reason for copyright?

+78
json javascript cdn
Jun 08 '10 at 3:15
source share
5 answers

Checkout cdnjs.com

http://cdnjs.com/libraries/json2/

It might be worth exploring Json3

http://cdnjs.com/libraries/json3/

UPDATE . Some information was outdated, changed to better links.

+60
Mar 28 '11 at 19:46
source share
+19
Feb 08 '12 at 19:29
source share

I think it might be too early to expect large CDNs to start doing this. When a sufficient number of sites uses the library, the advantages become clear: greater availability, more frequent use, reduced client requests, increased productivity for the end user. If only a few sites use it, the likelihood that a client who has a copy in their cache is already low, and all performance improvements are lost. So all that remains is that MS and Google offset your bandwidth costs, which is not their intention. So the solution is to get more developers to use the library.

Plus the library is so tiny. The code is still only 3.5 KB using a conservative estimate. For comparison, jQuery is 24K and ext-core is 29K. I personally recommend folding the library into my own JS site database and improving performance. At least until there is wider adoption.

Plus, itโ€™s funny that I expected the JSON library to be hosted also on Yahoo, but I canโ€™t find it. I mean Crockford works there.

+5
Jun 08 '10 at 6:14
source share

Thomas from cdnjs.com is here with two quick thoughts on why there is no shortened version.

1) the script may not be able to function as the author intended to use the selection method that we select. 2) As a security step, we guarantee that all the checksums of the files match the original files posted by the author, therefore the updates submitted by the community cannot contain the wrong code.

So, now that we leave Crockfords with us, a hosted version without a mini version; https://github.com/douglascrockford/JSON-js/raw/master/json2.js

+4
May 12 '11 at 1:44
source share

Now it is.

Douglas Crockford recently installed JSON2 on github, this url will always refer to the latest version.

Edit: It is not recommended to use this method, see my comment below.

+2
Dec 02 '10 at 20:17
source share



All Articles