Skip to content

Instantly share code, notes, and snippets.

@joostdevries
Created July 23, 2013 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joostdevries/6060936 to your computer and use it in GitHub Desktop.
Save joostdevries/6060936 to your computer and use it in GitHub Desktop.
Using the werkzeug debugger if you're testing AJAX calls to your API.
$(window).ajaxError(function(evt, evtData) {
if(evtData && ('responseText' in evtData)) {
var debuggerWindow = window.open('about:blank', 'debuggerWindow');
debuggerWindow.document.open();
debuggerWindow.document.write(evtData.responseText);
debuggerWindow.document.close();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment