Which version will you select for MSXML2.XMLHTTP without a version suffix?

Probably every web developer is familiar with this pattern:

var xmlHttp = null;
if (window.XMLHttpRequest) {
  // If IE7, Mozilla, Safari, and so on: Use native object.
  xmlHttp = new XMLHttpRequest();
}
else
{
  if (window.ActiveXObject) {
     // ...otherwise, use the ActiveX control for IE5.x and IE6.
     xmlHttp = new ActiveXObject('MSXML2.XMLHTTP');
  }
}

But the question is, if several versions of MSXML are available on the client PC (say, 3.0, 5.0, 6.0), one of them will be selected by calling MSXML2.XMLHTTP (the suffix of the version is not indicated at the end)? Will it be the last or not?

And a side question - is it possible to check which version was selected?

+5
source share
1 answer

As stated in Using the correct version of MSXML in Internet Explorer :

Theres " " ProgID MSXML. ProgID MSXML 3 ( , MSXML, ). , ProgID "3.0" ProgID .

, , , MSXML2.XMLHTTP - ProgID. - Windows, .

regedit Find .

, "version", .

+4

All Articles