aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-01-20 11:58:52 -0500
committerjeresig <jeresig@gmail.com>2011-01-20 11:58:52 -0500
commitea5ce8c2a916ad44af21411d6e2b21ab9f6863f0 (patch)
tree2ded9d177a12adbc917e22cfb056d23e28e4c189 /src/ajax
parente4d01688932960896419dc52ffd691cc4f9b3029 (diff)
parentf2b0c77dc84d3019db96de0c060207a5063f2055 (diff)
downloadjquery-ea5ce8c2a916ad44af21411d6e2b21ab9f6863f0.tar.gz
jquery-ea5ce8c2a916ad44af21411d6e2b21ab9f6863f0.zip
Merge branch 'master' of github.com:jquery/jquery
Diffstat (limited to 'src/ajax')
-rw-r--r--src/ajax/xhr.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index 4acb70054..cd9838c3b 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -12,8 +12,8 @@ var // Next active xhr id
// XHR used to determine supports properties
testXHR;
-// Create the request object; Microsoft failed to properly
-// (This is still attached to ajaxSettings for backward compatibility reasons)
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
@@ -146,8 +146,9 @@ if ( jQuery.support.ajax ) {
// Get info
var status = xhr.status,
statusText,
- response,
- responseHeaders = xhr.getAllResponseHeaders();
+ responseHeaders = xhr.getAllResponseHeaders(),
+ responses = {},
+ xml = xhr.responseXML;
try { // Firefox throws an exception when accessing statusText for faulty cross-domain requests
@@ -184,15 +185,15 @@ if ( jQuery.support.ajax ) {
status
);
- // Guess response & update dataType accordingly
- response =
- s.determineDataType(
- xhr.getResponseHeader("content-type"),
- xhr.responseText,
- xhr.responseXML );
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
// Call complete
- complete(status,statusText,response,responseHeaders);
+ complete(status,statusText,s.determineResponse( responses,
+ xhr.getResponseHeader( "content-type" ) ),responseHeaders);
}
}
};