Skip to content

Instantly share code, notes, and snippets.

@takumin
Created May 14, 2012 02:42
Show Gist options
  • Save takumin/2691476 to your computer and use it in GitHub Desktop.
Save takumin/2691476 to your computer and use it in GitHub Desktop.
function XMLHttpRequest() {
var progIDs = [
"Msxml2.ServerXMLHTTP.6.0",
"Msxml2.ServerXMLHTTP.5.0",
"Msxml2.ServerXMLHTTP.4.0",
"Msxml2.ServerXMLHTTP.3.0",
"Msxml2.ServerXMLHTTP",
"Microsoft.ServerXMLHTTP",
"Msxml2.XMLHTTP.6.0",
"Msxml2.XMLHTTP.5.0",
"Msxml2.XMLHTTP.4.0",
"Msxml2.XMLHTTP.3.0",
"Msxml2.XMLHTTP",
"Microsoft.XMLHTTP"
];
var i;
for (i = 0; i < progIDs.length; ++i) {
try {
return new ActiveXObject(progIDs[i]);
} catch (e) {
if (i == progIDs.length - 1) {
throw e;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment