mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
There's enough logic going on in jQuery.ajaxSettings.xhr to warrant splitting the function based upon the functionality.
This commit is contained in:
parent
84dd82eb1a
commit
c68fbc2071
11
src/ajax.js
11
src/ajax.js
@ -178,16 +178,15 @@ jQuery.extend({
|
|||||||
// implement the XMLHttpRequest in IE7 (can't request local files),
|
// implement the XMLHttpRequest in IE7 (can't request local files),
|
||||||
// so we use the ActiveXObject when it is available
|
// so we use the ActiveXObject when it is available
|
||||||
// This function can be overriden by calling jQuery.ajaxSetup
|
// This function can be overriden by calling jQuery.ajaxSetup
|
||||||
xhr: function() {
|
xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
|
||||||
if ( window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ) {
|
function() {
|
||||||
return new window.XMLHttpRequest();
|
return new window.XMLHttpRequest();
|
||||||
|
} :
|
||||||
} else {
|
function() {
|
||||||
try {
|
try {
|
||||||
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
},
|
||||||
},
|
|
||||||
accepts: {
|
accepts: {
|
||||||
xml: "application/xml, text/xml",
|
xml: "application/xml, text/xml",
|
||||||
html: "text/html",
|
html: "text/html",
|
||||||
|
Loading…
Reference in New Issue
Block a user