X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=82c499b6498d82c427a591f4be9f8b4c4280db6b;hb=5a721cf31b142365954a2d71e860534da4536b16;hp=d570fcccb8173d02e34ddf59e118fff4ebdc3ec0;hpb=4e86766d54a71263f8e7cbf2957405e12d9b8b36;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index d570fcc..82c499b 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -61,26 +61,34 @@ jQuery.fn.extend({ type: type, dataType: "html", data: params, - complete: function( res, status ) { + // Complete callback (responseText is used internally) + complete: function( jXHR, status, responseText ) { + // Store the response as specified by the jXHR object + responseText = jXHR.responseText; // If successful, inject the HTML into all the matched elements - if ( status === "success" || status === "notmodified" ) { + if ( jXHR.isResolved() ) { + // #4825: Get the actual response in case + // a dataFilter is present in ajaxSettings + jXHR.done(function( r ) { + responseText = r; + }); // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("