jQuery:

http://www.ruanyifeng.com/blog/2011/08/jquery_best_practices.html

http://www.ruanyifeng.com/blog/2011/08/a_detailed_explanation_of_jquery_deferred_object.html