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.
Written by Macs Dickinson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ajax
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#