From fe621cd8eeb473e123089caec92aac19861c8984 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 25 Jun 2013 12:37:03 +0200 Subject: [PATCH] added a ajax error handler. sometimes errors occur on the client side. because of the ajax.complete() callback is not fired the loading indicator does not disappear and the ui feels like the request runs endless, even if it already terminated with an error. --- php-console.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php-console.js b/php-console.js index f9f8710..b45e722 100644 --- a/php-console.js +++ b/php-console.js @@ -75,6 +75,11 @@ refreshKrumoState(); }); }; + + handleAjaxError = function(event, jqxhr, settings, exception) { + $('div.output').html("Error occured while posting your code."); + refreshKrumoState(); + }; initializeAce = function() { var PhpMode, code; @@ -120,6 +125,7 @@ $(function() { $(document).ready(initializeAce); + $(document).ajaxError(handleAjaxError); $('form').submit(handleSubmit); });