Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12168 closed bug (invalid)

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

Reported by: james.m.greene@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8rc1
Keywords: Cc:
Blocked by: Blocking:

Description

I know that jqXHR.success(), jqXHR.error(), and jqXHR.complete() are being deprecated in favor of jqXHR.done(), jqXHR.fail(), 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.

Change History (1)

comment:1 Changed 7 years ago by dmethvin

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.

Note: See TracTickets for help on using tickets.