以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 HTML/XHTML/Ajax/Web 2.0/Web 3.0 』  (http://bbs.xml.org.cn/list.asp?boardid=22)
----  初级问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=22&rootid=&id=44357)


--  作者:hbl888
--  发布时间:3/24/2007 9:22:00 AM

--  初级问题
function oAjax( url ,callback)
{
 alert("1");
 alert(url);
 alert(callback);
    try{
        this.HttpRequest = null;
        this.Debug  = false;
        this.Url = url;
        this.ContentType = "text/xml";
        this.HttpRequest = this.createXMLHttpRequest();

        if ( this.HttpRequest == null )
        {
            this._debug("XMLHttpRequest create failure!");
            return;
        }

        var xhReq = this.HttpRequest;
        xhReq.onreadystatechange = function (){
            oAjax._OnReadyStateChange( xhReq,callback );
        }

    } catch(e){
       this._debug( "unknow err: " + e.message );
    }
}
是什么意思呀


--  作者:Qr
--  发布时间:3/24/2007 11:47:00 AM

--  
function oAjax( url ,callback)
{
alert("1");
alert(url);
alert(callback);
    try{
        this.HttpRequest = null;
        this.Debug  = false;
        this.Url = url;//请求的URL
        this.ContentType = "text/xml";//返回结果的类型
        this.HttpRequest = this.createXMLHttpRequest();//创建XMLHttpRequest对象,创建过程在createXMLHttpRequest()中

        //如果对象创建失败,返回提示
        if ( this.HttpRequest == null )
        {
            this._debug("XMLHttpRequest create failure!");
            return;
        }

        //如果对象创建成功,执行回调函数
        var xhReq = this.HttpRequest;
        xhReq.onreadystatechange = function (){
            oAjax._OnReadyStateChange( xhReq,callback );
        }

    } catch(e){
       this._debug( "unknow err: " + e.message );
    }
}


--  作者:jx
--  发布时间:3/25/2007 7:36:00 PM

--  
Qr真是热心啊,水平也高!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms