Weird behavior that I don't understand. Need advise.
in Using jQuery
•
6 years ago
Hi,
I create dynamically a busy indicator so no real need for the entire code. I do show the indicator before doing a long running process for populating lists. The piece of code you see here is at the bottom of the function that creates the busy indicator and I'm calling the callback to say ok the busy is there so go on and do your long running process but instead of seeing the indicator before the long running process, the process runs before and then I see the indicator after the process is finished huh ? If I put the callback(); line in comment, I see the busy indicator all right so it does the right thing but why I don't see it before this long running process baffles me specially when the work is in the callback so in theory it should show the busy indicator before the long running process or there's something I don't understand and I need guidelines.
- $(BusyContainer).appendTo('body').promise().done(function
() {
if (callback && typeof (callback) === "function") {
callback();
}
});
1