Skip to content Skip to sidebar Skip to footer

Httprequest To Node Server Works In Ie 8 But Not Ie 7

Trying to find a work around for users who have IE 7. Basically in my client-side javascript application the below code makes a httprequest to a server running node.js and I get a

Solution 1:

not sure but you need to tweak CreateXmlHttpReq function to handle different types of Microsoft's ActiveXObjects

function CreateXmlHttpReq(handler) {
    var xmlhttp = null;

    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        var types = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Microsoft.XMLHTTP"];

        for (var i = 0; i < types.length; i++) {
            try {
                xmlhttp = new ActiveXObject(types[i]);
                break;
            } catch(e) {}
        }
    }

    if (xmlhttp) {
         xmlhttp.onreadystatechange = handler;
    }

    return xmlhttp;
}

Post a Comment for "Httprequest To Node Server Works In Ie 8 But Not Ie 7"