Home / Articles / How To Use AJAX

How To Use AJAX

Article Description

AJAX, an acronym for Asynchronous JavaScript and XML, is very hot in the growing universe of Web development. While this new technology offers some great capabilities, it also sparks some unquestionable debate over issues with the Back button. Kris Hadlock explains how to use AJAX in a real-world situation and how you can assess its value in a project. By the time you finish reading this article, you'll know what AJAX is as well as where, why, and how to use it.

Like this article? We recommend

Adobe Photoshop CS2 Official JavaScript Reference

Adobe Photoshop CS2 Official JavaScript Reference

$39.99

Common Properties and Methods

Tables 1 and 2 provide an overview of the properties and methods supported by Windows Internet Explorer 5, Mozilla, Netscape 7, Safari 1.2, and Opera.

Table 1 Properties

Property

Description

onreadystatechange

Event handler that fires when the state of the request object changes.

readyState

Returns values that indicate the current state of the object.

responseText

String version of the response from the server.

responseXML

DOM-compatible document object of the response from the server.

status

Status code of the response from the server.

statusText

Status message returned as a string.

Table 2 Methods

Method

Description

Abort()

Cancels the current HTTP request.

getAllResponseHeaders()

Retrieves the values of all the HTTP headers.

getResponseHeader("headerLabel")

Retrieves the value of an HTTP header from the response body.

open("method", "URL"[, asyncFlag[, "userName"[, "password"]]])

Initializes an MSXML2.XMLHTTP request, specifying the method, URL, and authentication information for the request.

send(content)

Sends an HTTP request to the server and receives a response.

setRequestHeader("label", "value")

Specifies the name of an HTTP header.

3. Where To Start | Next Section Previous Section