There are two progid's. I've seen both used.
Anyone have any insight as to when I should use one, versus the other?
There are two progid's. I've seen both used.
Anyone have any insight as to when I should use one, versus the other?
Hai Cheeso,
Have a look at these
http://bytes.com/topic/javascript/answers/559991-msxml-xmlhttp-vs-microsoft-xmlhttp
Maybe not exactly the answer you want, but that, if you are developping an Ajax application, I'd say you shouldn't use either of those : instead, you should use a Javascript Framework that will deal with browser compatibility, and not re-fight that battle.
For instance (there are many more) :
And, as a sidenote, they'll get you plenty of other useful stuff ;-)
This code takes care of both IE and firefox.
try {
XMLHttpRequestObject = new ActiveXObject("MSXML2.XMLHTTP");
} catch (exception1) {
try {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
} catch (exception2) {
XMLHttpRequestObject = false;
}
}
if (!XMLHttpRequestObject && window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
}
You should definitely not use Microsoft.XmlHttp.
From the Microsoft XML Team blog: Using the right version of MSXML in Internet Explorer:
MSXML2 vs. Microsoft namespace – I’ve also seen a lot of code that instantiates the "
Microsoft.XMLHTTP
" ActiveX object rather than theMSXML2.XMLHTTP.3.0
orMSXML2.XMLHTTP.6.0
if you’re using 6.0. The “Microsoft” namespace is actually older and is only implemented in MSXML3 for legacy support. It’s unfortunate we used the “better” name on the older version, but stick to the “msxml2” namespace when instantiating objects.