Friday, December 02, 2005

JavaScript XmlHttp

A simple cross-platform XmlHttp code snippet:

function newXmlHttp() {
    if (window.XMLHttpRequest) { 
        return new XMLHttpRequest();
    } else if (window.ActiveXObject) { 
        return new ActiveXObject("Msxml2.XMLHttp");
    }
    return null;
}

No comments: