-
-
Save beradrian/5d30bcbf7e8e0d9b5090 to your computer and use it in GitHub Desktop.
Tiny XMLHTTPRequest shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"]; | |
if (typeof XMLHttpRequest === "undefined") { | |
for (var i = 0; i < ids.length; i++) { | |
try { | |
new ActiveXObject(ids[i]); | |
window.XMLHttpRequest = function() { | |
return new ActiveXObject(ids[i]); | |
}; | |
break; | |
} catch (e) {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment