JSON

Developing the next generation of open data interchange

« PreviousNext »

New JavaScript JSON library

30 October 2007

Douglas Crockford has just posted a new version of his JavaScript JSON library that uses the original API with JSON.stringify and JSON.parse. It is available at http://www.JSON.org/json2.js. I am very happy to see this new library, as it does not pollute Object.prototype and Array.prototype and therefore does not force defensive enumeration by library users.

Posted in Uncategorized | Trackback | del.icio.us | Top Of Page

    2 Responses to “New JavaScript JSON library”

  1. Cedric Says:

    Kris,

    Thanks for posting this update - I completely missed the importance of this. This will work much better with my code - I wonder if we could convince Prototype to stop overloading the Object?

  2. Kris Zyp Says:

    I have no problem with overloading Object, that doesn’t affect enumeration at all. It is only Object.prototype, and to a lesser extent Array.prototype. I don’t believe Prototype modifies Object.prototype, but I think it does modify Array.prototype. I prefer to not modify array because you can use the somewhat more compact for-in syntax to iterate an array. With the Array.prototype modified you have to use the more standard i

Leave a Reply