Let me try to make some sense...
We're blocking the UI using jQuery block UI plugin
$(document).ajaxStart(function() { $.blockUI({ message: '<h4><i class="fa fa-circle-o-notch fa-spin fa-fw"></i> loading...</h4>' }) }).ajaxStop($.unblockUI);
Sometimes, when the code throws some error:
The loading message on the freezed screen doesn't vanishes:
The reason is:
When the ajaxStart()
starts, the $.blockUI()
gets invoked.
And before the ajaxStart()
could successfully finish executing, it encounters an error.
ajaxStop()
is never reached and the UI is never unblocked ($.unblockUI
)
So, what I'm looking for is a way to show some custom message when there is some error between ajaxStart()
and ajaxStop()
. Instead of code pausing/freezing on javascript error.
Doesn't it make sense?