无刷新取数据的一个例子

来源:互联网 发布:java classloader 反射 编辑:程序博客网 时间:2024/06/05 21:51

 function getResultValue() { var oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); oXmlHttp.Open("POST", "ProcessReport.aspx", false); oXmlHttp.send(""+dateFrom+""+type+""+dateTo+""); //window.alert(oXmlHttp.ResponseText); if (oXmlHttp.ResponseText!="") { window.document.all.pResult.style.display=""; window.document.all.pResult.innerHTML=oXmlHttp.ResponseText; window.document.all.DivWait.style.display="none"; document.all.btnLogin.style.display=''; window.document.all.divPrint.style.display=''; //window.document.all.btnExport.style.display=""; return; } setTimeout("getResultValue()",1000); }

 

 XmlDocument xmldoc = new XmlDocument();
   xmldoc.Load(Request.InputStream); 

   type=xmldoc.SelectSingleNode("//type").InnerText ;
   if (type=="close")
   {
     return;
   }

   dateFrom=xmldoc.SelectSingleNode("//dateFrom").InnerText ;
   dateTo =xmldoc.SelectSingleNode("//dateTo").InnerText ;