mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
-8 bytes
This commit is contained in:
parent
9cb1ab436d
commit
bab6f5355c
11
src/ajax.js
11
src/ajax.js
@ -165,10 +165,9 @@ jQuery.fn.extend({
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
var selector, type,
|
var selector, type, response,
|
||||||
self = this,
|
self = this,
|
||||||
off = url.indexOf(" "),
|
off = url.indexOf(" ");
|
||||||
response;
|
|
||||||
|
|
||||||
if ( off >= 0 ) {
|
if ( off >= 0 ) {
|
||||||
selector = url.slice( off, url.length );
|
selector = url.slice( off, url.length );
|
||||||
@ -197,13 +196,13 @@ jQuery.fn.extend({
|
|||||||
data: params,
|
data: params,
|
||||||
complete: function( jqXHR, status ) {
|
complete: function( jqXHR, status ) {
|
||||||
if ( callback ) {
|
if ( callback ) {
|
||||||
self.each( callback, [ status === "success" ? response : jqXHR.responseText, status, jqXHR ] );
|
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).done(function( responseText ) {
|
}).done(function( responseText ) {
|
||||||
|
|
||||||
// Save response text for use in complete callback
|
// Save response for use in complete callback
|
||||||
response = responseText;
|
response = arguments;
|
||||||
|
|
||||||
// See if a selector was specified
|
// See if a selector was specified
|
||||||
self.html( selector ?
|
self.html( selector ?
|
||||||
|
Loading…
Reference in New Issue
Block a user