John first mentioned JSON about a month ago, but at the time I had no inclination to look into it and find out if it was something I could use. It came across my radar again today thanks to a Particle Tree article that I never finished reading, but that’s not important. The long and short of it is that JSON is really just a fancy name for eval-ing JavaScript objects - one of those “why didn’t I think of that” kinds of things.

The few times I’ve tried using Ajax, I’ve spent most of my time fighting with XML parsing (or convincing IE that it was XML I was trying to parse), so the allure of native JavaScript objects was enticing. I talked with one of the guys at work about writing a function in PHP that would take an array and generate the appropriate code, until I came across the (seemingly de facto) “official” JSON page. He’s got references there for pretty much every language you’d expect to do web development in (and a few you wouldn’t) - including JSON-PHP, which does exactly what I was going to. Couple that with Prototype’s quick-and-dirty Ajax.Request, and you’ve got a Web 2.0 application quicker than you can say “What the hell is a Web 2.0 application?”

QuirksBlog has a pretty good post comparing JSON, XML, and HTML snippets, if you’d like to further consider your Ajaxing options.