var xmlHttpRequest;
function fnquery(){
var cypz = '${cpcyModel.cypz}';
var ajx = 'true';
xmlHttpRequest = new XMLHttpRequest(); 
        xmlHttpRequest.onreadystatechange = callback; 
        xmlHttpRequest.open("GET", "<%=webapp%>/cpcy/cpcyAction!list.dhtml?firstFlag=clear&ajax="+ajx, true);
        xmlHttpRequest.send(null);  
}
//回调函数 
   function callback() { 
   alert(xmlHttpRequest.readyState);
       //alert(xmlHttpRequest.readyState); 
       //5。接收响应数据 
       //判断对象的状态是交互完成 
       if (xmlHttpRequest.readyState == 4) { 
           //判断http的交互是否成功 
           if (xmlHttpRequest.status == 200) { 
               //获取服务器器端返回的数据 
               //获取服务器段输出的纯文本数据 
              var responseText = xmlHttpRequest.responseText; 
               alert(responseText);
          if("true" == responseText) {
         
$("#form1").attr('action','cpcyAction!enterlist.dhtml');
$("#form1").attr('method','post');
$("#form1").submit();
}
           } else { 
               alert("出错了!!!"); 
           } 
       } 
   } 

相关文章:

  • 2021-07-14
  • 2022-01-10
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-09-05
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2021-07-18
  • 2021-06-17
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案