git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '8013p' of https://github.com/rwldrn/jquery into rwldrn-8013p
[jquery.git]
/
src
/
ajax
/
xhr.js
diff --git
a/src/ajax/xhr.js
b/src/ajax/xhr.js
index
0f30469
..
7a4da2d
100644
(file)
--- 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;
// 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),
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
@@
-53,7
+53,7
@@
testXHR = undefined;
// Create transport if the browser can provide an xhr
if ( jQuery.support.ajax ) {
// Create transport if the browser can provide an xhr
if ( jQuery.support.ajax ) {
- jQuery.ajaxTransport( function( s , determineDataType ) {
+ jQuery.ajaxTransport( function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( ! s.crossDomain || jQuery.support.cors ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( ! s.crossDomain || jQuery.support.cors ) {
@@
-128,7
+128,6
@@
if ( jQuery.support.ajax ) {
callback = 0;
// Do not keep as active anymore
callback = 0;
// Do not keep as active anymore
- // and store back into pool
if (handle) {
xhr.onreadystatechange = jQuery.noop;
delete xhrs[ handle ];
if (handle) {
xhr.onreadystatechange = jQuery.noop;
delete xhrs[ handle ];
@@
-146,8
+145,15
@@
if ( jQuery.support.ajax ) {
// Get info
var status = xhr.status,
statusText,
// Get info
var status = xhr.status,
statusText,
- response,
- responseHeaders = xhr.getAllResponseHeaders();
+ responseHeaders = xhr.getAllResponseHeaders(),
+ responses = {},
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+ responses.text = xhr.responseText;
try { // Firefox throws an exception when accessing statusText for faulty cross-domain requests
try { // Firefox throws an exception when accessing statusText for faulty cross-domain requests
@@
-184,16
+190,8
@@
if ( jQuery.support.ajax ) {
status
);
status
);
- // Guess response & update dataType accordingly
- response =
- determineDataType(
- s,
- xhr.getResponseHeader("content-type"),
- xhr.responseText,
- xhr.responseXML );
-
// Call complete
// Call complete
- complete(status,statusText,response,responseHeaders);
+ complete(status,statusText,responses,responseHeaders);
}
}
};
}
}
};