Commit b2289f3e authored by jeresig's avatar jeresig

Try to use XMLHttpRequest in more cases in IE 7. Thanks to Matt Kruse and Sam...

Try to use XMLHttpRequest in more cases in IE 7. Thanks to Matt Kruse and Sam Collett for the suggestions. Fixes #3623, #2849, #5338, and #5529.
parent 25ee9cee
...@@ -175,12 +175,13 @@ jQuery.extend({ ...@@ -175,12 +175,13 @@ jQuery.extend({
traditional: false, traditional: false,
*/ */
// Create the request object; Microsoft failed to properly // Create the request object; Microsoft failed to properly
// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available // 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 // This function can be overriden by calling jQuery.ajaxSetup
xhr: function() { xhr: function() {
return window.ActiveXObject ? return window.XMLHttpRequest && window.location.protocol !== "file:" || window.ActiveXObject ?
new ActiveXObject("Microsoft.XMLHTTP") : new window.XMLHttpRequest() :
new XMLHttpRequest(); new window.ActiveXObject("Microsoft.XMLHTTP");
}, },
accepts: { accepts: {
xml: "application/xml, text/xml", xml: "application/xml, text/xml",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment