mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Ajax: remove deprecated extensions from ajax promise
Fixes gh-2084 Closes gh-2092
This commit is contained in:
parent
8b6aeae52d
commit
9d1b989f20
10
src/ajax.js
10
src/ajax.js
@ -487,9 +487,7 @@ jQuery.extend({
|
||||
};
|
||||
|
||||
// Attach deferreds
|
||||
deferred.promise( jqXHR ).complete = completeDeferred.add;
|
||||
jqXHR.success = jqXHR.done;
|
||||
jqXHR.error = jqXHR.fail;
|
||||
deferred.promise( jqXHR );
|
||||
|
||||
// Remove hash character (#7531: and string promotion)
|
||||
// Add protocol if not provided (prefilters might expect it)
|
||||
@ -619,9 +617,9 @@ jQuery.extend({
|
||||
strAbort = "abort";
|
||||
|
||||
// Install callbacks on deferreds
|
||||
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
||||
jqXHR[ i ]( s[ i ] );
|
||||
}
|
||||
completeDeferred.add( s.complete );
|
||||
jqXHR.done( s.success );
|
||||
jqXHR.fail( s.error );
|
||||
|
||||
// Get transport
|
||||
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
||||
|
@ -77,11 +77,11 @@ module( "ajax", {
|
||||
},
|
||||
success: true,
|
||||
afterSend: function( request ) {
|
||||
request.complete(function() {
|
||||
request.always(function() {
|
||||
ok( true, "complete" );
|
||||
}).success(function() {
|
||||
}).done(function() {
|
||||
ok( true, "success" );
|
||||
}).error(function() {
|
||||
}).fail(function() {
|
||||
ok( false, "error" );
|
||||
});
|
||||
}
|
||||
@ -95,11 +95,11 @@ module( "ajax", {
|
||||
},
|
||||
success: true,
|
||||
complete: function( xhr ) {
|
||||
xhr.complete(function() {
|
||||
xhr.always(function() {
|
||||
ok( true, "complete" );
|
||||
}).success(function() {
|
||||
}).done(function() {
|
||||
ok( true, "success" );
|
||||
}).error(function() {
|
||||
}).fail(function() {
|
||||
ok( false, "error" );
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user