We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

The read-only XMLHttpRequest.status property returns the numerical status code of the response of the XMLHttpRequest. status will be an unsigned short. Before the request is complete, the value of status will be 0. It is worth noting that browsers report a status of 0 in case of XMLHttpRequest errors too.

The status codes returned are the standard HTTP status codes. For example, status 200 denotes a successful request. If the server response doesn't explicitly specify a status code, XMLHttpRequest.status will assume the default value of 200.


var xhr = new XMLHttpRequest();
console.log('UNSENT', xhr.status);

xhr.open('GET', '/server', true);
console.log('OPENED', xhr.status);

xhr.onprogress = function () {
  console.log('LOADING', xhr.status);

xhr.onload = function () {
  console.log('DONE', xhr.status);


 * Outputs the following:
 * LOADING 200
 * DONE 200


Specification Status Comment
XMLHttpRequest Living Standard WHATWG living standard

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support1 Yes171 Yes1.2
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes Yes Yes ? ?

1. Internet Explorer version 5 and 6 supported ajax calls using ActiveXObject()

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, ExE_Boss, tatarik, erikadoyle, jsx
 Last updated by: Sheppy,