XMLHttpRequest Event Handler Properties: onerror

By: Dusty Arlia
Published on Thursday, November 20, 2014 at 7:21 PM
Last Updated on Sunday, July 19, 2015 at 10:21 AM
Total Updates: 2

The onerror event handler property of the XMLHttpRequest JavaScript object can be assigned an event handler function. The error event is triggered when a XMLHttpRequest HTTP request fails with an error event. HTTP status codes do not count as errors since the HTTP response completes successfully. A DNS failure while trying to resolve the URL or an infinite loop of redirects would both cause an error event.