Skip to content

Commit fe621cd

Browse files
committed
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.
1 parent 5d057d7 commit fe621cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

php-console.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
refreshKrumoState();
7676
});
7777
};
78+
79+
handleAjaxError = function(event, jqxhr, settings, exception) {
80+
$('div.output').html("<em>Error occured while posting your code.</em>");
81+
refreshKrumoState();
82+
};
7883

7984
initializeAce = function() {
8085
var PhpMode, code;
@@ -120,6 +125,7 @@
120125

121126
$(function() {
122127
$(document).ready(initializeAce);
128+
$(document).ajaxError(handleAjaxError);
123129

124130
$('form').submit(handleSubmit);
125131
});

0 commit comments

Comments
 (0)