Probably every web developer is familiar with a pattern like this:
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 there are multiple MSXML versions available on the client’s PC (let’s say 3.0, 5.0, 6.0), which one of them will be chosen by MSXML2.XMLHTTP call (notice no version suffix at the end)? Will it be the latest or – not necessarily?
And a side-question – is it possible to check which version was chosen?
As stated in Using the right version of MSXML in Internet Explorer:
That should be more than clear enough I would think, since we know MSXML2.XMLHTTP is a version independent ProgID. But a lot of Web page scrivners aren’t Windows programmers I suppose.
For proof just use regedit and do a Find on this string.
As far as I can tell there isn’t any “version” property to be checked.