]> source.dussan.org Git - jquery.git/commitdiff
-8 bytes 762/head
authorOleg <markelog@gmail.com>
Thu, 3 May 2012 20:13:28 +0000 (00:13 +0400)
committerOleg <markelog@gmail.com>
Thu, 3 May 2012 20:18:08 +0000 (00:18 +0400)
src/ajax.js

index 77e4d33e3a86111b78f5bbafe9c2c2097e6189ac..80e3b11dfdf58c8e5ba542b37fbfbd9d904fd6f9 100644 (file)
@@ -165,10 +165,9 @@ jQuery.fn.extend({
                        return this;
                }
 
-               var selector, type,
+               var selector, type, response,
                        self = this,
-                       off = url.indexOf(" "),
-                       response;
+                       off = url.indexOf(" ");
 
                if ( off >= 0 ) {
                        selector = url.slice( off, url.length );
@@ -197,13 +196,13 @@ jQuery.fn.extend({
                        data: params,
                        complete: function( jqXHR, status ) {
                                if ( callback ) {
-                                       self.each( callback, [ status === "success" ? response : jqXHR.responseText, status, jqXHR ] );
+                                       self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
                                }
                        }
                }).done(function( responseText ) {
 
-                       // Save response text for use in complete callback
-                       response = responseText;
+                       // Save response for use in complete callback
+                       response = arguments;
 
                        // See if a selector was specified
                        self.html( selector ?