Speeding Up AJAX with JSON

XML is the standard way to interchange data, but it’s often not the best way. Although XML can add structure and metadata to data, it does so in an overly verbose way. XML also has a fairly complex syntax, requiring a non-trivial parser to attack it. In JavaScript, XML must be parsed into a DOM tree to be used. And, once you’ve constructed the DOM tree, you still have to pilot through it to create corresponding JavaScript objects or otherwise use the XML data in your client-side Web application.

Fortunately, there’s a better way.

Welcome to JSON

The JavaScript Object Notation, or JSON, is a lightweight syntax for representing data. JSON’s elegance comes from the fact that it’s a subset of the JavaScript language itself.

Link

  • Share/Bookmark

1 Comment

AnonymousSeptember 18th, 2007 at 6:10 am

XML is not “the standard way to interchange data”.
XML is A standard, not THE standard.
And it isn’t even very standard.
Hooray for JSON.

Leave a comment

Your comment