User Tools

Site Tools


xmlhttprequest

Voir https://xhr.spec.whatwg.org/

readyState

UNSENT0The object has been constructed.
OPENED1The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method.
HEADERS_RECEIVED2All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available.
LOADING3The response entity body is being received.
DONE4The data transfer has been completed or something went wrong during the transfer (e.g. infinite redirects).

Status

- If the state is UNSENT or OPENED, return 0. - If the error flag is set, return 0. - Return the HTTP status code.

Events

note : ajouter on devant chaque nom d'event pour usage, ex pour readystatechange :

xhr.onreadystatechange = function() {
    	// blablabla
};

(xhr étant un objet XMLHttpRequest)

Event nameInterfaceDispatched when…
readystatechangeEventThe readyState attribute changes value, except when it changes to UNSENT.
loadstartProgressEventThe request starts.
progressProgressEventTransmitting data.
abortProgressEventThe request has been aborted. For instance, by invoking the abort() method.
errorProgressEventThe request has failed.
loadProgressEventThe request has successfully completed.
timeoutProgressEventThe author specified timeout has passed before the request completed.
loadendProgressEventThe request has completed (either in success or failure).
xmlhttprequest.txt · Last modified: 2015/10/06 18:16 by 95.211.60.11