Skip to main content

Bug Tracker

Side navigation

#12168 closed bug (invalid)

Opened July 31, 2012 07:31PM UTC

Closed July 31, 2012 09:56PM UTC

Inconsistency: jqXHR.{success|error|complete} deprecated but alternatives not present in ajax settings or global ajax handlers

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8rc1
Keywords: Cc:
Blocked by: Blocking:

I know that ''jqXHR.success()'', ''jqXHR.error()'', and ''jqXHR.complete()'' are being deprecated in favor of ''jqXHR.done()'', '''', and ''jqXHR.always()'', respectively, as cited in the "Deprecation Notice" on the $.ajax documentation page.

However, it appears that the $.ajax settings object still has keys for "success", "error", and "complete" but NOT for the equivalent Promise/Deferred-based functions (again: "done", "fail", and "always", respectively). Will these keys be deprecated and replaced by the currently non-existent alternatives as well?

Same question for the global AJAX event handlers ''$.ajaxSuccess()'', ''$.ajaxError()'', and ''$.ajaxComplete()'': will these be deprecated and replaced by the currently non-existent ''$.ajaxDone()'', ''$.ajaxFail()'', and ''$.ajaxAlways()'', respectively?

The divergence there is a bit confusing.

Attachments (0)
Change History (1)

Changed July 31, 2012 09:56PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

I think that everything currently documented is correct.

Deferred/Promise use different nomenclature than the callback names. jqXHR is a Promise so it uses Promise nomenclature. It just created more naming confusion to use the callback names as aliases in a Promise, plus they only lasted as long as the current promise so that you can't do $.ajax().then().success() for example.

Bottom line, if you are using a Promise (including a jqXHR) then use the Promise naming.