Published by nick on 24 Apr 2009
Why on earth doesn’t javascript have a json_encode?!
Every major language now has tools for JSON encoding a string of text, which is a format that is natively read, understand, and used by Javascript. PHP’s json_encode works great, I use it all the time for data transport. The reasons for using XML are getting harder and harder to come by. JSON is much easier to work with.
Every major language has a built in json_encode, except, Javascript!
WTF? Irony at it’s best.
I’m using Douglas Crockford’s JSON.js in the meantime, but Firefox, Internet Explorer, Safari developers - please include support for this in a future release.
Update Jun 29 2009: I was listened too.
Firefox 3.1+ and IE 8+ now have native JSON support. More info