John L.
John L.

Reputation: 1953

XMLHttpRequest Error Details

How can the XMLHttpRequest error details be logged via Javascript when error event occurs? I could not find such a property of the error event. But when using developer tools of browsers, the developer tools supply the detailed information about the error. Is there a way to do this via Javascript?

Upvotes: 2

Views: 260

Answers (1)

illusivetech
illusivetech

Reputation: 139

You can add an event listener an output the event object.

request.addEventListener("error",function(event) {console.log(event);},false);

Upvotes: 2

Related Questions