IN THIS CHAPTER
This chapter is all about working in-depth in Ajax applications. In this chapter the Document Object Model (DOM) and handling events are described. A huge part of Ajax programming involves working in the Web page, of course, and the DOM lets you do that kind of work. Using the DOM you can append elements to what's already there, replace elements, search for and find elements, and so on. Event handling is also important when you're working with Ajax, and in this chapter you're going to see how to handle events to create a drag-and-drop Ajax-enabled shopping cart.
Your Web browser sees an HTML document as a tree of nodes that support properties and methods you can use to navigate or edit that page in real time. Those properties and methods are specified in the HTML Document Object Model, or DOM.
The DOM is the creation of the World Wide Web Consortium (W3C). For the rigorous DOM details, take a look at http://www.w3.org/DOM/.
For example, here's the code for an innocent-looking Web page:
<html> <head> <title> Hello from HTML </title> </head> ...