« New bloggers in our midst | Main| Lotusphere 2007 Sessions, a.k.a. My Big Sexy HTML Post »

Cleaning up the factory

Category None

After some more research and Johan's link, some interesting tidbits about MSXML2 including its sordid history became more apparent.  So I've cut the factory down to size:

function initXMLHttpRequest(){
        var objHTTP = null;
        if (window.XMLHttpRequest) { //IE7 with native XMLHTTP and FF
        try{
           objHTTP = new XMLHttpRequest();
        }catch(e){}
      }else if(window.ActiveXObject){ //IE7 without native XMLHTTP, IE6 and below
                if(g_XMLHttpRequest_ActiveX){
                        objHTTP = new ActiveXObject(g_XMLHttpRequest_ActiveX);
                }else{
                   var xmlhttp = new Array(
                     'Msxml2.XMLHTTP.7.0',
                     'Msxml2.XMLHTTP.6.0',
                     'Msxml2.XMLHTTP.5.0',
                     'Msxml2.XMLHTTP.4.0',
                     'MSXML2.XMLHTTP.3.0',
                     'MSXML2.XMLHTTP',
                     'Microsoft.XMLHTTP');
                        for(var i = 0; i < xmlhttp.length; i++){                        
                                try{
                                        objHTTP = new ActiveXObject(xmlhttp[i]);
                                        if(objHTTP != null){
                                                g_XMLHttpRequest_ActiveX = xmlhttp[i];
                                                break;
                                        }
                                }catch(e){}
                        }
                }
        }
        return objHTTP;
}

So why the cutbacks?  Based on the XML Team's blog entry, here's why:
Msxml2.XMLHTTP.7.0 Doesn't exist - we put it there for future protection but 6 is the highest we'll see for a while. It's shipping in Vista.
Msxml2.XMLHTTP.5.0 Was specifically for Microsoft Office applications. Irrelevant to web applications.
Msxml2.XMLHTTP.4.0 No maintenance work on this version, 3.0 is the default fallback.
Msxml2.XMLHTTP This gives the same result as 3.0 - it is the default. No need for this one.
Microsoft.XMLHTTP Not recommended, an old namespace.


Good catch and thanks to the XML team for posting the details and history of this bad boy.

By the way, if you read the first post, you might catch that I made a clarification in the comment "//IE7 with native XMLHTTP and FF".  This is because as I mentioned in IE7 there is native support for the XHR object and no need to invoke the ActiveX stuff - but only if it's turned on (which it is by default).  But if you notice a browser using ActiveX, here's the setting:

A picture named M2

Happy Ajax-ing...

Calendar

Rock On With Me and SNAPPS

Join me and the great team at SNAPPS at these upcoming events:

IamLUG
I am Lotus User Group - August 2-4, St. Louis

Collaboration University
London and Chicago - September 21-23 and 27-29 respectively. That's right, London goes first!

The events have very limited capacity so signing up as soon as possible is recommended. Hope to see you there!

Be With the Band

Follow me on Twitter!


Opt in to receive Rob's semi-regular newsletter about Quickr, Sametime, Free Stuff and Conferences. Just enter your email address below, you can unsubscribe at any time.

Subscribe to my newsletters...
Email:

On With The Show

Here is a list of the SNAPPS templates for Lotus Quickr and other free resources on QuickrTemplates.com:
Templates:
QContacts
QIdeas
QIssues
QMeeting
QPhotos
QPresent
QProject
QSite
QSurvey

Utilities:
AnyPlace SiteMap
AnyPlace ServerMap
AnyPlace Designer for Dreamweaver

Free Apps:
PandaBear: Cross-Platform File Management
Flippr: Lightweight Quickr Admin Client
SnappFiles: iPhone Client for Quickr, Filenet, ICM...

Downloads: 104,397
Countries: 161
Read about the templates in Intranet Journal

Search

Googles

  • No Search Referers