This course is out of date and does not reflect our standards or industry best practices. We now recommend you take the Complete Intro to Web Development, v3 course.

Check out a free preview of the full Learning jQuery course:
The "$.ajax Responses" Lesson is part of the full, Learning jQuery course featured in this preview video. Here's what you'd learn in this lesson:

Before jQuery 1.5, response handlers could were set as options (success, error, complete) Make sure to handle errors (think network outages) Now $.ajax returns a promise interface (jqXHR subset of xhr), a Deferred object. Read more about deferreds: http://api.jquery.com/category/deferred-object/ Instead of using options use done, fail and always methods. Using them you can add multiple handlers. If ajax has been completed they will fire method immediately (like document ready)

Get Unlimited Access Now