日期:2014-05-18  浏览次数:20393 次

为什么这里老出错?
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;
                        }