建立XMLHttpRequest对象方法

~~~浏览器

//建立XMLHttpRequest对象
    function creatXmlHttpRequest() {
        var xmlHttp;
        try{
            //非IE浏览器使用
            xmlHttp = new XMLHttpRequest();
        }catch(e){
            try{
                xmlHttp = new ActiveXobject("Msxm.XMLHTTP");
            }catch(e){
                try{
                    xmlHttp = new ActiveXobject("Microsoft.XMLHTTP");
                }catch(e){

                }
            }
        }
        return xmlHttp;
    }

    ~~~
相关文章
相关标签/搜索