When utilizing the XMLHttpRequest class to send payload data from a web client to a web server, I encounter some common errors that need to be handled...
- REQUEST TIMEOUT (CONNECTION TIMEOUT)
- 500, INTERNAL SERVER ERROR
- 502, BAD GATEWAY
- 503, SERVICE UNAVAILABLE
I am unsure about how to properly utilize the onstatechange, onerror, and ontimeout properties. Can onreadystatechange alone catch these errors?
If I need to use onerror or ontimeout, I would like to understand the distinctions between these handlers and onreadystatechange.