大智

快乐工作中生活

 

Ajax

http://www.okajax.com/info/web/20060926.html
清单 4. 以支持多种浏览器的方式创建 XMLHttpRequest 对象

/* Create a new XMLHttpRequest object to talk to the Web server */
            var xmlHttp = false;
            /*@cc_on @*/
            /*@if (@_jscript_version >= 5)
            try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
            try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e2) {
            xmlHttp = false;
            }
            }
            @end @*/
            if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
            xmlHttp = new XMLHttpRequest();
            }
            

posted on 2007-06-30 13:10  lgzh  阅读(129)  评论(0)    收藏  举报

导航