Skip to content

Commit

Permalink
Ajax: replace "jqXHR.complete" callback with "always"
Browse files Browse the repository at this point in the history
Since it was deprecated since 1.8.

Also add additional comments which explains tricky
behaviour of "always" callback

Closes gh-2033
  • Loading branch information
markelog committed Feb 14, 2015
1 parent 4ef120d commit 97ef1f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ajax/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ jQuery.fn.load = function( url, params, callback ) {
// Otherwise use the full result
responseText );

}).complete( callback && function( jqXHR, status ) {
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
}).always( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
Expand Down

0 comments on commit 97ef1f2

Please sign in to comment.