Hello.
I think this is a classic problem, but don't know the right way to solve
Need to show a progressbar and hide it when an ajax call gets done (either success or fail).
In some scenarios ajax call finishes _before_ progressbar is shown, thus the progress bar never closes.
Whats the right way to write this code?
function doSomeThingWithAjax() {
$.messager.progress({height:75, text:'Working'});
$.ajax({
type: 'GET',
url: myUrl,
data: { ... },
dataType: 'json',
success: function (result) { .... },
error: function() {....},
complete: function() {
$.messager.progress('close');
}
});
}
Thanks in advance
Juan Antonio