In AJAX applications, client-server communication is usually packed in XML documents, or in the JSON (JavaScript Object Notation) format. Interestingly enough, JSON’s popularity increased together with the AJAX phenomenon, although the AJAX acronym includes XML. JSON is the format used by the Microsoft AJAX Library and the ASP.NET AJAX Framework to exchange data between the AJAX client and the server, which is why it deserves a quick look here. As you’ll learn, the Microsoft AJAX Library handles JSON data packaging through Sys.Serialization.JavaScriptSerializer
, which is described in the Appendix—but more on this later.
Perhaps the best short description of JSON is the one proposed by its official website,
http://www.json.org
: “JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.”
If you’re new to JSON, a fair question you could ask would be: why another data exchange...