I use this plugin (http://malsup.com/jquery/block/) to show some loading effects for my ajax call using jQuery.
I defined a global ajax error handling :
$( document ).ajaxError(function( event, request, settings ) {
toastr['error']('error happened on this url: '+ settings.url);
$.unblockUI();
});
But the fact is I block elements, not global page, like :
$('form').submit(function(e) {
e.preventDefault();
$(this).block();
// my ajax call with error
$.post('.....');
}
So is there any way to unblock all elements blocked ? $.unblockUI(); is only unblocking the page, not all elements being blocked before.
Ok, the easiest way I found for now is :
Seems to work.