当我在执行查询操作时,由于数据比较多,所以要很长时间才能将查询结果显示出来,能不能在查询结果没出来之前,在显示数据的地方显示“正在查询...”,请问怎么实现?

解决方案 »

  1.   

    可以。。本人是用javascript写的,你可以拿来参考一下。
    document.write("<div style='border: 1px solid #999999;background-color: #eeeeee;vertical-align: middle; text-
    align:center;position:absolute;top:30;width:500px; height:200px;left:120;font-size:9pt;' id='loading'>")
    document.write("<br>")
    document.write("<br>")
    document.write("<br>")
    document.write("<br>")
    document.write("<br>")
    document.write("<br>")
    document.write("<span id='loading_text' style='margin-top:100px;color: #0066CC;'>正在查询数据,请稍等......</span>")
    document.write("</div>")
    document.write("<scr" + "ipt>")
    document.write("function flashs(){")
    document.write("if(loading_text.style.color=='#eeeeee'){")
    document.write("    loading_text.style.color='#0066CC';")
    document.write("    setTimeout('flashs()',500);")
    document.write("    }")
    document.write("else{")
    document.write("    loading_text.style.color='#eeeeee';")
    document.write("    setTimeout('flashs()',500);")
    document.write("    }")
    document.write("}")
    document.write("</sc"+"ript>")
    记得要先调用一次flashs()函数,否则几个中文字不会闪动。
      

  2.   

    <BODY onload="f_bodyonload()">
    <script language="JavaScript" src="../PLAN/lib/error.js"> </script>
    <Div name=wait_div id=wait_div align=center style='position:absolute; top:10px; width:100% ;left:0px; Z-INDEX: 9999;cursor:wait;display: ' >
       <table width=100% border=0 cellspacing=0 cellpadding=1 >
          <tr class=fn_tr>
             <td>资料检查</td>
          </tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
          <tr><td align='center'>资料检查中,请稍等...^_^</td></tr>
       </table>
    </Div><script language="JavaScript">   function f_bodyonload(){
          wait_div.style.display = 'none'
       }
    </script>
    试试
    后台代码里用:
    response.flush()