patch for trying more XMLHTTP activeX objects

patch for trying more XMLHTTP activeX objects


We've run into a client that has some weird setup who for whatever
reason (thin clients/terminal server/non-admin users, etc) is having
an error when they try to instantiate Microsoft.XMLHTTP in IE6, and
yet MSXML2.XMLHttp.5.0 works. We don't know why, and at this point
we've stopped caring.
Basically our solution was simply to try a bit harder when ActiveX is
available by trying additional versions of the XMLHTTP object.
For people that don't have a problem the behavior should be the exact
same as in 1.2.6.
What do people think of this patch? I'd like to see it (or something
like it) patched into ajax.js so that we don't have to maintain a
separate version. To that end does anyone have suggestions? Should I
post a trac issue?
-Charles
276,308c276,278
<
<         // a helper method for retrieving a working xmlhttp request
<         function getXMLHTTPRequest() {
<             var requester = false;
<             // Create the request object; Microsoft failed to properly
<             // implement the XMLHttpRequest in IE7, so we use the
ActiveXObject when it is available
<             if (window.ActiveXObject) {
<                 var aVersions = [    "Microsoft.XMLHTTP",
<                                     "MSXML2.XMLHttp.6.0",
<                                     "MSXML2.XMLHttp.5.0",
<                                     "MSXML2.XMLHttp.4.0",
<                                     "MSXML2.XMLHttp.3.0",
<                                     "MSXML2.XMLHttp"];
<                 for(var i = 0; i< aVersions.length;i++){
<                      try {
<                          requester = new ActiveXObject(aVersions[i]);
<                          return requester;
<                     }
<                      catch (error) {
<                         continue;
<                      }
<                 }
<             } else if (window.XMLHttpRequest) {
<             // Firefox, Opera 8.0+, Safari
<                 requester = new XMLHttpRequest();
<                 return requester;
<             }
<
<             throw new Error("XMLHttp object could be created.");
<         }
<
<
<         var xhr = getXMLHTTPRequest();
---