Commit fd80f597 authored by Oleg Gaidarenko's avatar Oleg Gaidarenko

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

(cherry-picked from 97ef1f2612a9c5bd453d34146fdfd552cf9cee67)
Closes gh-2033
parent 1d3d2b1a
...@@ -66,7 +66,10 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -66,7 +66,10 @@ jQuery.fn.load = function( url, params, callback ) {
// Otherwise use the full result // Otherwise use the full result
responseText ); 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 ] ); self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment