IN THIS CHAPTER
It's time to write some Ajax. In this chapter you see how to write complete Ajax applications from soup to nuts. In particular, you're going to see how to create and work with the XMLHttpRequest object. Because this object is the central object on which Ajax is based, the XMLHttpRequest object is going to be at the very heart of all the Ajax applications you write.
This application boasts a button with the caption “Fetch the Message.” When you click that button, the application uses Ajax techniques to download text behind the scenes and display it.
The data that the application reads from the server is stored in a file named data.txt. Here are the contents of that file:
This text was fetched from the server with Ajax.
When you click the button in this application, the application downloads this text ...