Atif Aziz, Scott Mitchell February 2007 Applies to: JSON Ajax Summary: This article discusses Java Script Object Notation (or JSON), an open and text-based data exchange format, that provides a standardized data exchange format better suited for Ajax-style web applications.
(22 printed pages) Introduction Understanding Literal Notation in Java Script Comparing JSON to XML Creating and Parsing JSON Messages with Java Script Working with JSON in the .
NET Framework Conclusion References Download the source code for this article.
There are a variety of open, standardized options, and the ideal choice depends on the applications requirements and pre-existing functionality.
For example, SOAP-based web services format the data in an XML payload wrapped within a SOAP envelope.
While XML works well for many application scenarios, it has some drawbacks that make it less than ideal for others.
One such space where XML is often less than ideal is with Ajax-style web applications.
Ajax is a technique used for building interactive web applications that provide a snappier user experience through the use of out-of-band, lightweight calls to the web server in lieu of full-page postbacks.
These asynchronous calls are initiated on the client using Java Script and involve formatting data, sending it to a web server, and parsing and working with the returned data.
While most browsers can construct, send, and parse XML, Java Script Object Notation (or JSON) provides a standardized data exchange format that is better-suited for Ajax-style web applications.
JSON is an open, text-based data exchange format (see RFC 4627).
Like XML, it is human-readable, platform independent, and enjoys a wide availability of implementations.