javascript – Is there a publicly available CDN that hosts JSON2?-ThrowExceptions

Exception or error:

It’s well known that Google and Microsoft host several common javascript libraries on their CDNs (content distribution networks). Unfortunately neither seems to host JSON2.js.

I’m aware that I could upload a copy of JSON2.js to my server and serve it myself, but there are a number advantages CDNs offer that I would like to take advantage of.

So with that in mind, are there any publicly available CDNs that host JSON2? If not, any idea why? Is there some sort of copyright reason?

How to solve:


Might also be worth investigating Json3

UPDATE: Some of the information was out of date, changed to better links.


json2.js can be found on Yandex CDN servers.

Full version:


HTTPS also works.


I think probably it’s too early to expect the big CDNs to start doing this. When enough sites are using a library, the benefits become clear: greater availability, more frequent use, reduced client requests, increased performance for the end user. If only a few sites are using it, chances of client having a copy in their cache already is low and all performance boosts are lost. So all that’s left is that MS and Google offset your bandwidth charges, which is not their intention. Thus, the solution is to get more developers to use the library.

Plus the library is so tiny. The code is still only 3.5KB using conservative minification. For comparison, jQuery is 24KB and ext-core is 29KB. I’d personally recommend folding the library into your own site’s base JS and get your performance boost there. At least until there’s wider acceptance.

Plus, it’s funny I’d have expected the JSON library to be hosted also at Yahoo, but I can’t find it. I mean Crockford works there.


Thomas from here with two quick reasons why there is no minified version.

1) The script may not possibly function as the author intended using the method of minification we choose.
2) As a security step we ensure that all files checksums match the original authors hosted files so community submitted updates cannot contain malformed minified code.

So for now that leaves us hosting Crockfords hosted un-minified version;


There is now.

Douglas Crockford recently put JSON2 on github, this url will always link to the most recent version.

Its not a good idea to use this method, see my comment below.

Leave a Reply

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