I'm having some trouble with getting some events to fire correctly upon
AJAX completion.  Basically what I am doing is going through a for
loop that fires off an ajax call for each element in an array.  When the
results come back, if it is successful I want to change an image from
an hourglass (waiting) to an check mark (success!).

What I've come to after trying different things is creating two classes
.waiting & .checked and have the following line:

$('#'+manager).removeClass('waiting').addClass('checked');

The weird thing (at least to me), is that it removes the waiting class
but doesn't add the checked class until all of the ajax requests are
done.  I know all of the ajax calls are basically being run at the same
time, but if it's removing the class when that particular call is done,
shouldn't it add the other class at the same time?  Am I missing some
fundamental piece of ajax behavior or jquery?

Thanks!
Erik

Reply via email to