X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=35d83e4fabbbd62aa0d92a8303ef2c587362aade;hb=c68fbc2071f67876edbb3fca202362aecb82ca9c;hp=9501e8a07eb0189fd6078a706ebec3a578e8b000;hpb=6861b5d4eb16222ed5ea623af6ce75362b55d1d4;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 9501e8a..35d83e4 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -178,16 +178,15 @@ 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", html: "text/html",