};
// 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)
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 );
},
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" );
});
}
},
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" );
});
}