Consider the following AJAX code:
function loadReport() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("data").innerHTML = this.responseText;
}
};
xhttp.open("GET", "report.txt", true);
xhttp.send();
}
The readyState property holds the status of the XMLHttpRequest. So, this.readyState == 4 means that