熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

點擊按鈕後,出現事件處理等待過程.

2013-11-15 11:45:38  來源: JSP教程 

  腳本說明:
 
把如下代碼加入<body>區域中
 <script language=javascript>

  function do_totals()

  {

  documentallpleasewaitScreenstylepixelTop = (documentbodyscrollTop + );

  documentallpleasewaitScreenstylevisibility=visible;

  windowsetTimeout(do_totals());

  } 

  function do_totals()

  {

  lengthy_calculation();

  documentallpleasewaitScreenstylevisibility=hidden;

  }

  function lengthy_calculation()

  {

  var xy

  for(x=;x<;x++)

  {

  y += (x * y) / (y x);   

  }

  }
  
  </script>
  <DIV ID=pleasewaitScreen STYLE=position:absolute;zindex:;top:%;left:%;visibility:hidden>
   <TABLE BGCOLOR=# BORDER= BORDERCOLOR=# CELLPADDING= CELLSPACING= HEIGHT= WIDTH= ID=Table>
    <TR>
     <TD WIDTH=% HEIGHT=% BGCOLOR=silver ALIGN=CENTER VALIGN=MIDDLE>
      <FONT FACE=Arial SIZE= COLOR=blue><B>正在處理中<br>
        請稍等</B></FONT>
     </TD>
    </TR>
   </TABLE>
  </DIV>
  <p align=center>
   <input type=button name=btn_calc value=處理等待 onclick=do_totals()>
  </p>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19565.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.