当前位置: 代码迷 >> Web前端 >> dwr 同步处置等待服务器返回数据时 配置等待页面
  详细解决方案

dwr 同步处置等待服务器返回数据时 配置等待页面

热度:89   发布时间:2012-11-19 10:18:51.0
dwr 同步处理等待服务器返回数据时 配置等待页面

转自:http://www.iteye.com/problems/1387

2008-07-09 congjl2002 (资深程序员)

如下代码可以锁定页面,思路就是在框架下面加上几个div,然后定义div样式,每次提交后让div覆盖整个页面,提交结束后在隐藏
<html xmlns="http://www.w3.org/1999/xhtml">    
<head>    
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
<title>?? </title>    
<style type="text/css">    
a{ color:#000; font-size:12px;text-decoration:none}    
a:hover{ color:#900; text-decoration:underline}    
  
#massage_box{ position:absolute; left:expression((body.clientWidth-40)/2); top:expression((body.clientHeight-40)/2); width:40px; height:40px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}    
#mask{ position:absolute; top:0; left:0; bottom:0;width:expression(body.scrollWidth); height:100%; background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}    
.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}    
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}    
</style>    
<script>    
 function createXMLHttpRequest()     
  {     
   if(window.ActiveXObject)     
   {     
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");     
   }     
   else     
   {     
    if(window.XMLHttpRequest)     
    {     
     xmlHttp = new XMLHttpRequest();     
    }     
   }     
  }     
  
  function LoadPageWait()     
  {     
   createXMLHttpRequest();     
   var url = "http://www.iteye.com";     
   xmlHttp.open("GET", url, true);     
   xmlHttp.onreadystatechange = goCallback;     
   xmlHttp.send(null);     
  }     
  
  function goCallback()     
  {       
       
  
   mask.style.visibility='visible';    
   massage_box.style.visibility='visible';    
WriteData();   
       
  }     
  function WriteData()     
  {     
   window.location.replace("http://www.iteye.com");     
   return false;     
  }    
</script>    
</head>    
  
<body>    
  
   <label>    
   <input type="submit" name="test" id="test" value="a"  onclick="LoadPageWait()"/>    
   </label>    
  
      
<p>    
<div id="massage_box"> <div class="massage">    
  
<img src="loading.gif" width="32" height="32" />    
</div> </div>    
<div id="mask"> </div>    
  
</body>    
</html>
?
  相关解决方案