Retrieves the HTTP status code of the request.
Syntax
[ nStatus = ] XMLHttpRequest.status
Possible Values
nStatus | Integer that
receives the HTTP status code. |
The property is read-only.
The property has no default value.
Remarks
status was introduced in Windows Internet Explorer 7.
For a complete list of HTTP status codes and their meanings, see status Property (IXMLHTTPRequest).
Example
The following script checks the HTTP status code to determine if the request was successful:
if (oReq.status == 401)
alert('Access denied.');
else
alert(oReq.responseText);
Standards Information
This property is defined in
The XMLHttpRequest Object (W3C Working Draft)
.
Applies To