Several states of Document.readystate
The 0-uninitialized:xml object is generated, but no files are loaded.
1-loading: The loader is in progress, but the file has not started parsing.
2-loaded: Some of the files have been loaded and parsed, but the object model has not yet taken effect.
3-interactive: Valid only for partially loaded files, in which case the object model is valid but read-only.
4-completed: The file has been fully loaded, representing a successful load.
Https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState
onReadyStateChange belongs to XMLHttpRequest.
var New XMLHttpRequest (), = "GET", = "https://developer.mozilla.org/"truefunction () { if (Xmlhttp.readystate = = = Xmlhttprequest.done && Xmlhttp.status = = =) console.log (Xmlhttp.responsetext) ; }; Xmlhttp.send ();
JQuery events. Load (),. Ready (),. Unload ()
Document.readystate and Xmlhttp.onreadystatechange