O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and Sending Requests

The key to implementing the Ajax-style communication described above is the JavaScript request object, which is built into Internet Explorer 6.0 and later, Firefox 0.8 and later, Opera 7.54 and later, and Safari 1.2.2 and later. Your JavaScript can use this request object to query a webserver for information, store the returned information, and update the page when the server has provided the information.

There are four steps involved in using JavaScript to make an Ajax request:

  1. Creating a request object

  2. Telling the request object where to send the request

  3. Telling the object what to do when the request is answered

  4. Telling the object to make the request

Creating a Request Object

The first step in making an Ajax request is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required