Last Updated: January 28, 2019
· macsdickinson

Open AJAX error response in a new window

Ever get annoyed when inspecting errors returned from your failed AJAX calls? I do. This following function will open up the response in a new window.

function popUpError(err) {
    var output = err.responseText;
    var openWindow ="errorDetails.html", "mywin", '');
    openWindow.dataFromParent = output;

Probably not one to leave in when your code goes to production but it can speed things up a little during the development process.