当前位置: 代码迷 >> ASP.NET >> 为什么这里老出错?解决办法
  详细解决方案

为什么这里老出错?解决办法

热度:9233   发布时间:2013-02-25 00:00:00.0
为什么这里老出错?
var   httpxml;
        //创建对象
        function   creathttpxml()
        {
       
                if(window.ActiveXObject)
                {
                        httpxml=new   ActiveXObject( "Microsoft.XMLHTTP ");
               
                }
                else   if(window.XMLHttpRequest)
                                {
                                        httpxml=new   XMLHttpRequest();
                               
                                }
       
       
        }
        //调用
        function   getdata()
        {
                creathttpxml();
               
                httpxml.onreadystatechange=fangfa;
              var     txtcon=document.getElementById( "txt1 ").value+ "| "+document.getElementById( "txtname ").value;
                httpxml.open( "post ", "xmlcr.aspx?con= "+escape(txtcon),false);
               
                httpxml.send(null);
       
       
       
        }
        function   fangfa()
        {
        //是否完成状态
                if(httpxml.readystate==4)
                {
                //判断是否执行成功
                        if(httpxml.status==200)
                        {
                          //alert(httpxml.responsetext);
                          qiege(httpxml.responsetext);
                      //     document.getElementById( "div ").innerText=httpxml.responsetext;
                        }
               
                }
          }

        function   qiege(data)
  相关解决方案