X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=968c67c8ac8917251d00e0f07c3c1b3d92723328;hb=e221d39e981ceac030d2e0431570742fb51337d5;hp=dbea8d5d4883365540119f80aaad19ea7846cd2c;hpb=0f28835ee91a8aec5f9de60be42b55b802c67928;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index dbea8d5..968c67c 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -11,6 +11,7 @@ var r20 = /%20/g, rselectTextarea = /^(?:select|textarea)/i, rts = /([?&])_=[^&]*/, rurl = /^(\w+:)?\/\/([^\/?#:]+)(?::(\d+))?/, + rCRLF = /\r?\n/g, // Slice function sliceFunc = Array.prototype.slice, @@ -60,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("