Three ways of attaching success, failure and completion callbacks to jQuery $.ajax()
While using jQuery $.ajax you often need to perform some custom operations upon successful completion of the Ajax request. You may also need to handle errors (if any) that are thrown while issuing the request. To that end jQuery allows you to wire three callback functions. Moreover these callbacks can be wired using three distinct techniques as illustrated in this article.
http://www.bipinjoshi.net/articles/749ed588-b408-4a7e-94da-77549c00e803.aspx