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:
There’s a lot of confusion around the “version-independent” ProgID for MSXML. The version-independent ProgID is always bound to MSXML 3 (a lot of people think it picks up the latest MSXML that is on the box). This means the version independent ProgID and the “3.0” ProgIDs will return the same object.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With