Contents

Preface

Acknowledgments

Part I: Fundamental Ajax

Chapter 1: Essential Ajax

What Does “Ajax” Mean?

What Can You Do with Ajax?

Create Ajax live searches

Create an Ajax-enabled calculator

Talk with Ajax chat applications

Crunch numbers with spreadsheets

Browse Amazon

Get the answer with Ajax autocomplete

Log in with Ajax

Download images

Drag and drop with Ajax

Play games with Ajax

Modify Web pages on the fly

Add interactivity to maps

E-mail the Ajax way

Summary

Chapter 2: Know Your JavaScript

What Is JavaScript's Place in Ajax?

A Brief History of JavaScript

Getting Started with JavaScript

Fixing errors

Commenting your code

Putting your code in external script files

Responding to browser events

Creating JavaScript Functions

Passing arguments to functions

Returning values from functions

Storing Your Data in Variables

Operating on Your Data with Operators

Making Decisions with the If Statement

Executing Different Code in Different Browsers

Working with Loops

Looping with the for loop

Looping with the while loop

Connecting JavaScript to HTML Buttons

Summary

Chapter 3: Creating Ajax Applications

Writing Ajax

Setting up the application

Writing the JavaScript

Creating an XMLHttpRequest object

Opening the XMLHttpRequest object

Handling data downloads

Getting your data

Downloading the data

More ways to create XMLHttpRequest objects

Interacting with Server-Side Code

Passing Data to Server-Side Scripts

Passing data to the server with GET

Passing data to the server with POST

Using Ajax ...

Get Ajax Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.