as a set of existing technologies used together in a new way, bound together
by a mechanism that lets you communicate between the browser and server
without reloading the entire page. In its most fundamental form, Ajax
requires that you understand only one new piece: the
equivalent depending on the browser). This is the object that allows you to
make a connection back to the originating server to request additional data.
Once you receive the data, you can use it to adjust only the portion of the
page that you need to update.
Although the object’s name and the term “Ajax” itself imply
that XML is the only format for exchanging data, there are others.
JSON is especially good because it lets you pass a string of
Certain practices simplify working with Ajax. Usually, it’s helpful to
load a library that abstracts the
XMLHttpRequest object. Fortunately, there are
several libraries that help with this. In addition, within the browser, the
MVC design pattern is a good model for maintaining a clear separation
between data changes and updates to a presentation. On the server, the same
principles discussed in Chapter 6 for managing data for complete pages can also provide a good structure for data in Ajax requests. These ideas ...