(Translated by https://www.hiragana.jp/)
status Property (XMLHttpRequest)
The Wayback Machine - https://web.archive.org/web/20080409015509/http://msdn2.microsoft.com:80/en-us/library/ms534650(VS.85).aspx
Click to Rate and Give Feedback
Properties
 status Property
status Property

Retrieves the HTTP status code of the request.

Syntax

[ nStatus = ] XMLHttpRequest.status

Possible Values

nStatusInteger 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) World Wide Web link.

Applies To

XMLHttpRequest
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker