Chapter 3. The Response

In Chapter 2, “The Request,” we started to discuss the response when we covered the ready state and status codes of the XHR. This chapter will go beyond this state of the request and focus on two specific data-interchange formats in which the response can be received. An Ajax response can come in various formats; the most common include JSON and the most widely accepted, XML. Each format can be useful depending on the results you are trying to achieve. However, deciding on a single format for your application can be useful as a convention for future management, especially if you are building a large-scale application. For example, if you decide to use XML as the response in one situation, it would be much easier to continue ...

Get Ajax for Web Application Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.