Datasheet

DOM: Dynamic updating of a loaded page
XML: Data exchange format
XSLT: Transforms XML into XHTML (styled by CSS)
XMLHttp: Primary communication broker
JavaScript: Scripting language used to program an Ajax engine
In reality, all these technologies are available to be used in Ajax solutions, but only three are required:
HTML/XHTML, DOM, and JavaScript. XHTML is obviously necessary for the displaying of informa-
tion, while the DOM is necessary to change portions of an XHTML page without reloading it. The last
part, JavaScript, is necessary to initiate the client-server communication and manipulate the DOM to
update the web page. The other technologies in the list are helpful in fine-tuning an Ajax solution, but
they aren’t necessary.
There is one major component that Garrett neglected to mention in his article: the necessity of server-
side processing. All of the previously listed technologies relate directly to the client-side Ajax engine, but
there is no Ajax without a stable, responsive server waiting to send content to the engine. For this pur-
pose, you can use the application server of your choice. Whether you choose to write your server-side
components as PHP pages, Java servlets, or .NET components, you need only ensure that the correct
data format is being sent back to the Ajax engine.
The examples in this book make use of as many server-side technologies as possible to give you enough
information to set up Ajax communication systems on a variety of servers. Most of the examples cov-
ered in the book are available in PHP, JSP, and ASP.NET versions at
www.wrox.com.
Who Is Using Ajax?
A number of commercial web sites use Ajax techniques to improve their user experience. These sites are
really more like web applications than traditional brochureware web sites that just display information
because you visit it to accomplish a specific goal. The following are some of the more well-known and
well-executed web applications that use Ajax.
Google Suggest
One of the first examples that developers cite when talking about Ajax is Google Suggest
(
www.google.com/webhp?complete=1). The interface is simply a clone of the main Google interface,
which prominently features a text box to enter search terms. Everything appears to be the same until you
start typing in the textbox. As you type, Google Suggest requests suggestions from the server, showing
you a drop-down list of search terms that you may be interested in. Each suggestion is displayed with a
number of results available for the given term to help you decide (see Figure 1-2).
This simple client-server interaction is very powerful and effective without being obtrusive to the user.
The interface is responsive beyond what you may have learned to expect from a web application; it
updates no matter how quickly you type and, as with autocomplete features in desktop software, you
can use the up and down arrows to highlight and select each item in the suggestions list. Although still
in beta, expect to see this approach make its way into the main Google page eventually.
7
What Is Ajax?
04_109496 ch01.qxd 2/5/07 6:47 PM Page 7