From c999b6613e1ad458bfaf0187740b52a8faf53418 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Tue, 22 Dec 2015 17:14:52 +0300 Subject: [PATCH] Revert "Ajax: remove deprecated extensions from ajax promise" This reverts commit 9368a8cd8ca81902b8359188668973e489fca6db. --- src/ajax.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index 409e3dc43..e92c29c75 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -515,7 +515,9 @@ jQuery.extend( { }; // Attach deferreds - deferred.promise( jqXHR ); + deferred.promise( jqXHR ).complete = completeDeferred.add; + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (prefilters might expect it) @@ -648,9 +650,9 @@ jQuery.extend( { strAbort = "abort"; // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); -- 2.39.5