日期:2014-05-19  浏览次数:20678 次

查询数据量较大。想在查询时弹出“正在查询..”的窗口
RT.
在做一个功能,读取的数据量较大时,会延迟7-10秒才得到结果,希望在执行过程中在网页弹出“正在查询”的小窗口,让用户不要放弃查询。功能由jsp+servlet实现,弹出窗口希望用JavaScript
求大神指导。。。

------解决方案--------------------
参考一下。。。
HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
<head>
    <title>Untitled</title>
    <script language="javascript">
        function _click() {
            waiting();
            setTimeout("reload()", 1000);
        }
         
        function reload() {
            divModal.style.display = "none";
            divProgressDialog.style.display = "none";
        }
         
        function waiting(){
            divModal.style.display = "";
            divModal.style.width = document.body.scrollWidth; 
            divModal.style.height = document.body.scrollHeight; 
            divProgressDialog.style.display = ""; 
            divProgressDialog.style.left = ((document.body.offsetWidth - divProgressDialog.offsetWidth) / 2); 
            divProgressDialog.style.top = ((document.body.offsetHeight - divProgressDialog.offsetHeight) / 2); 
        } 
    </script>
</head>
 
<body>
<input id="btn" name="btn" type="button" value="Search" onclick="_click();" />
<input id="sexMale" style="width:20px;" type="radio" checked="checked" name="Sex" value="0"/>男
<input id="sexMale" style="width:20px;" type="radio" name="Sex" value="1"/>女</p>
<DIV STYLE="FONT-SIZE: 8pt; Z-INDEX: ? FONT-FAMILY: Tahoma; 
POSITION: absolute; DISPLAY: none; 
CURSOR: default" ID="divProgressDialog" dir="ltr"> 
<DIV STYLE="PADDING: 3px;FONT-WEIGHT: bolder;COLOR:rgb(255, 0, 0)"> 
Loading......Please waitting......
</DIV> 
</DIV> 
<DIV ID="divModal"
STYLE="BORDER-TOP: white 1px groove; 
PADDING-BOTTOM: 5px; PADDING-TOP: 3px; 
BACKGROUND-COLOR: buttonface; 
TEXT-ALIGN: center; BACKGROUND-COLOR: white; 
FILTER: alpha(opacity=75); LEFT: 0px; POSITION: 
absolute; TOP: 1px; Z-INDEX: 3; DISPLAY: none;"> 
</DIV>
</body>
</html>