Last Updated: January 28, 2019
·
2.349K
· 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 = window.open("errorDetails.html", "mywin", '');
    openWindow.dataFromParent = output;
    openWindow.init();
}

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