Chapter 2. First steps with Ajax

 

This chapter covers

  • Introducing the technologies behind Ajax
  • Using Cascading Style Sheets to define look and feel
  • Using the Document Object Model to define the user interface structure
  • Using XMLHttpRequest to asynchronously contact the server
  • Putting the pieces together

In chapter 1 we focused on users and how Ajax can assist them in their daily activities. Most of us are developers, and so, having convinced ourselves that Ajax is a Good Thing, we need to know how to work with it. The good news is that, as with many brand-new, shiny technologies, most of this process will be reasonably familiar already, particularly if you’ve worked with the Internet.

In this chapter, we’ll explain the Ajax technology. We’ll discuss the four technological cornerstones of Ajax and how they relate to one another, using code examples to demonstrate how each technology works and how everything fits together.

You might like to think of this chapter as the “hello world” section of the book, in which we introduce the core technologies using some simple examples. We’re more interested here in just getting things to work; we’ll start to look at the bigger picture in chapter 3. If you’re already familiar with some or all of the Ajax technologies, you may want to skim these sections. If you’re new to Ajax and to web client programming, these introductions should be sufficient to orient you for the rest of the book.

2.1. The key elements of Ajax

2.2. Orchestrating the user experience with JavaScript

2.3. Defining look and feel using CSS

2.4. Organizing the view using the DOM

2.5. Loading data asynchronously using XML technologies

2.6. What sets Ajax apart

2.7. Summary

2.8. Resources