mirror of
https://github.com/jquery/jquery.git
synced 2026-02-05 20:45:02 -05:00
Fixes #7868. ResponseText is now properly propagated for error callbacks.
This commit is contained in:
@@ -464,6 +464,11 @@ jQuery.extend({
|
||||
} else { // if not success, mark it as an error
|
||||
|
||||
error = error || statusText;
|
||||
|
||||
// Set responseText if needed
|
||||
if ( response ) {
|
||||
jXHR.responseText = response;
|
||||
}
|
||||
}
|
||||
|
||||
// Set data for the fake xhr object
|
||||
|
||||
@@ -137,15 +137,13 @@ jQuery.ajax.transport( function( s , determineDataType ) {
|
||||
status
|
||||
);
|
||||
|
||||
// Guess response if needed & update datatype accordingly
|
||||
if ( status >= 200 && status < 300 ) {
|
||||
response =
|
||||
determineDataType(
|
||||
s,
|
||||
xhr.getResponseHeader("content-type"),
|
||||
xhr.responseText,
|
||||
xhr.responseXML );
|
||||
}
|
||||
// Guess response & update dataType accordingly
|
||||
response =
|
||||
determineDataType(
|
||||
s,
|
||||
xhr.getResponseHeader("content-type"),
|
||||
xhr.responseText,
|
||||
xhr.responseXML );
|
||||
}
|
||||
|
||||
// Call complete
|
||||
|
||||
Reference in New Issue
Block a user