I'm having a hard time working out a design pattern in Jquery to control multiple AJAX and Animations. I of course have the AJAX and Animations bound to some events like 'click' but I'm trying to keep the code modular with functions and adding wrapper methods ($.fn), but I don't know how to get code to run when a function or a wrapper method is complete.
EDIT: Ok, it's a bit challenging to add in some sample code. So here's some pseudo code:
clickEventFunction(){
ajaxRequest();
ajaxRequest2();
ajaxRequest3();
animationFunction();
}
after all ajaxRequests complete I want an animation to fire off.