Home / Questions / What is the purpose of the XMLHttpRequest.readyState property in AJAX?
Explanatory Question

What is the purpose of the XMLHttpRequest.readyState property in AJAX?

👁 106 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Answer: The XMLHttpRequest.readyState property represents the state of an AJAX request. It is an integer that goes through different values as the request progresses. The most important states are 4 (request finished and response is ready) and 0 (request not initialized). Developers often use this property in conjunction with the onreadystatechange event to determine the current state of the request.