Forum Moderators: open
var req;
function loadXMLDoc(url)
{
if(window.XMLHttpRequest) {
// code for Gecko/KHTML browsers
} else if(window.ActiveXObject) {
==> execution gets to here, then errors on next line
if(req = new ActiveXObject("Microsoft.XMLHTTP")) {
// code for Explorer
}
}
}
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
req = new ActiveXObject("Msxml2.XMLHTTP");
} ;)
function getXMLHttp()
{
var xml;
try
{
// Mozilla Browsers
xml = new XMLHttpRequest();
return xml;
}
catch(e){}
// IE Browsers
var progIDs = ["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
for(var currentProgID = 0;currentProgID < progIDs.length;currentProgID++)
{
try
{
xml = new ActiveXObject(progIDs[currentProgID]);
return xml;
}
catch(e){}
}
}
I assume "MSXML2.XMLHttp" came first and the numerical suffixes indicate more recent versions (like JavaScript1.2 et. al.)?
Currently, the default XML parser for Internet Explorer is MSXML 2.0 or MSXML 3.0, depending on the version of Internet Explorer. With the help of the xmslinst.exe utility, you can change the default parser to MSXML 2.6 or MSXML 3.0. However, this can often cause unintended side-effects for some applications. Therefore, such a practice is not enabled for MSXML versions 4.0 and later....
I think that means you can leave off the numeric extensions and Explorer will use it's default.