What is difference between xhr.status and xhr.readyState?

Member

kamryn.gulgowski

by kamryn.gulgowski, in category: Technology , 8 months ago

What is difference between xhr.status and xhr.readyState?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by graciela.bogisich , 8 months ago
  • xhr.status: used to determine whether the request was successful or not.
  • xhr.readyState: the state of the request'
  • xhr.readyState zero(0) means "has not yet been sent"
  • xhr.readyState zero(4) means "complete and response received"

The server provides the status, while the user agent provides the readyState.