ajax 原始代码

来源:互联网 发布:mysql explain 详解 编辑:程序博客网 时间:2024/04/29 07:30

<script language="javascript" type="text/javascript">
  var xmlHttpReq;
function CreateXmlHttpRequest()
{
 if(window.ActiveXObject)
   {
  
      xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
   }
   else  if(window.xmlhttpRequest)
   {
          xmlHttpReq= new XMLHttpRequest();

   }
 
  xmlHttpReq.onreadystatechange = doHttpReadyStateChange;
  xmlHttpReq.open("GET", "http://localhost/Maestro2006/QAC/CpkReport/CpkReport.aspx", true);
  xmlHttpReq.send();


 

}

function doHttpReadyStateChange()
 {
   if (xmlHttpReq.readyState == 4)
   {
     if(xmlHttpReq.status==200)
    { // alert("dfd");
   
        window.open('ReportResult.aspx');
     
     }
   }
}
 function OpenNewWin()
 {
    
   __doPostBack('<%=btnGetData.ClientID.Replace("_","$")%>','');
 
   CreateXmlHttpRequest();
 
   //document.getElementById(strBtnID).click();
   //document.getElementById("ff").click();
//if (document.forms['aspnetForm'].submit() != false)
//{
   //  window.open('ReportResult.aspx');
//}
  // QAC_CpkReport_CpkReport.GetData(GetColName_CallBack);
 }
 
 
 
</script> 

原创粉丝点击