Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In our Ajax examples so far, the server has rendered fragments of HTML and sent them to the browser. This is a perfectly acceptable technique, but we need to use the JSON data format if we want to use the browser to do anything more advanced with the data that we get from the server. The JavaScript Object Notation (JSON) format is a language-independent way of expressing data. It emerged from the JavaScript language but has long since taken on a life of its own and is very widely used. Listing 19-16 shows an Appointment object rendered as JSON.
{"ClientName":"Joe","Date":"1/1/2012","TermsAccepted":false} |