The rest of this chapter discusses these in detail.
1 W3C XMLHttpRequest Specification- http://www.w3.org/TR/
XMLHttpRequest/
1.3 XMLHttpRequest Object Properties 3
1.3.1 The readyState Property
The XMLHttpRequest object cycles through several states as it sends an
HTTP request to the server, waits while the request is processed, and when
it receives a response. So that scripts can respond appropriately to the
various states, the object exposes a readyState property that represents
the object's current state, as shown in Table 1.1.
Table 1.1 ReadyState Property Values
ReadyState Property Value Description
0 Represents an ???uninitialized??? state in which an
XMLHttpRequest object has been created, but
not initialized.
1 Represents a ???sent??? state in which code has
called the XMLHttpRequest open() method
and the XMLHttpRequest is ready to send a
request to the server.
2 Represents a ???sent??? state in which a request
has been sent to the server with the send()
method, but a response has not yet been
received.
3 Represents a ???receiving??? state in which the
HTTP response headers have been received,
but message body has not yet been completely
received.
4 Represents a ???loaded??? state in which the
response has been completely received.
1.3.2 The onreadystatechange Property
The XMLHttpRequest object generates a readystatechange
event whenever the readyState value changes.
Pages:
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30