Baseline Widely available
Hinweis: Diese Funktion ist in Web Workers verfügbar, mit Ausnahme von Service Workers.
Die schreibgeschützte XMLHttpRequest.status
-Eigenschaft gibt den numerischen HTTP-Statuscode der Antwort des XMLHttpRequest
zurück.
Bevor die Anfrage abgeschlossen ist, hat status
den Wert 0. Browser melden auch einen Status von 0 im Falle von XMLHttpRequest
-Fehlern.
Eine Zahl.
Beispieleconst xhr = new XMLHttpRequest();
console.log("UNSENT: ", xhr.status);
xhr.open("GET", "/server");
console.log("OPENED: ", xhr.status);
xhr.onprogress = () => {
console.log("LOADING: ", xhr.status);
};
xhr.onload = () => {
console.log("DONE: ", xhr.status);
};
xhr.send();
/**
* Outputs the following:
*
* UNSENT: 0
* OPENED: 0
* LOADING: 200
* DONE: 200
*/
Spezifikationen Browser-Kompatibilität Siehe auch MDN-Feedback-Box War diese Ãbersetzung hilfreich?
Diese Seite wurde automatisch aus dem Englischen übersetzt.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4