For example, i'm using the beforeSend option in the $.ajax function. In the code sample below, the .html function will get executed while the fade out is taking place on the statement before. How could i stop this behavior?
jQuery("#container").fadeOut("slow", function() {
jQuery("#container").removeClass('error');
});
jQuery("#container").html("success").fadeIn("slow");
So what happens is that during the fade out, jquery will inject the html "success". I want it to happen after the animation is complete.
How should i go about it?
Thanks!