mirror of
https://github.com/jquery/jquery.git
synced 2026-01-14 20:27:59 -05:00
Ajax: replace "jqXHR.complete" callback with "always"
Since it was deprecated since 1.8. Also add additional comments which explains tricky behaviour of "always" callback Closes gh-2033
This commit is contained in:
@@ -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 ] );
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user