Return to Snippet

Revision: 33221
at October 7, 2010 03:54 by ddavidd


Updated Code
/* Returns a HttpRequest object */
    function getHTTPObject() {
        try {
            // Opera 8.0+, Firefox, Safari
            return new XMLHttpRequest();
        } catch (e){
            // Internet Explorer Browsers
            try{
                return new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try{
                    return new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e){
                    // Something went wrong
                    alert("Your browser broke!");
                    return false;
                }
            }
        }
    }

Revision: 33220
at October 7, 2010 03:48 by ddavidd


Initial Code
    function getHTTPObject() {
        try {
            // Opera 8.0+, Firefox, Safari
            return new XMLHttpRequest();
        } catch (e){
            // Internet Explorer Browsers
            try{
                return new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try{
                    return new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e){
                    // Something went wrong
                    alert("Your browser broke!");
                    return false;
                }
            }
        }
    }

Initial URL

                                

Initial Description

                                

Initial Title
New Http Object

Initial Tags
http

Initial Language
JavaScript