diff options
author | jaubourg <j@ubourg.net> | 2011-01-09 04:53:29 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-09 04:53:29 +0100 |
commit | d515068ee807efef29b6c8406171be4725d7154f (patch) | |
tree | 2e6fdf125040e144a2a211ec9efc8d1e293c5522 /src | |
parent | 69497c3fd7ff560be0e47b4c65076915cca756bc (diff) | |
download | jquery-d515068ee807efef29b6c8406171be4725d7154f.tar.gz jquery-d515068ee807efef29b6c8406171be4725d7154f.zip |
Fixes #7868. ResponseText is now properly propagated for error callbacks.
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax.js | 5 | ||||
-rw-r--r-- | src/ajax/xhr.js | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/ajax.js b/src/ajax.js index a814d80be..744476f1a 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 032668f68..a2ec4a4c5 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -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 |