There's enough logic going on in jQuery.ajaxSettings.xhr to warrant splitting the function based upon the functionality.

This commit is contained in:
jeresig 2010-01-07 10:00:55 -05:00
parent 84dd82eb1a
commit c68fbc2071

View file

@ -178,15 +178,14 @@ jQuery.extend({
// implement the XMLHttpRequest in IE7 (can't request local files),
// so we use the ActiveXObject when it is available
// This function can be overriden by calling jQuery.ajaxSetup
xhr: function() {
if ( window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ) {
xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
function() {
return new window.XMLHttpRequest();
} else {
} :
function() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {}
}
},
accepts: {
xml: "application/xml, text/xml",