'Wait please ...' page

It is a common task for the web (JSP, servlets) developers. Suppose you have a very long calculation and need output some messages for users waiting your servlet's results. One solution described below deploys DHTML for solving this problem:


<style type="text/css">
    #waitpage { position: absolute; }
    #mainpage { position: absolute; visibility: hidden; }

<script language=\"JavaScript\">
function init ()
    if (document.layers)
      document.waitpage.visibility = 'hide';
      document.mainpage.visibility = 'show';
      if (document.all)
        document.all.waitpage.style.visibility = 'hidden';
        document.all.mainpage.style.visibility = 'visible';

<body onLoad="init();">

  <DIV ID="waitpage">

  <!-- your message is here: -->
  <center><i> Wait please ... </i></center>


  <!-- your very very long calculation is here -->
  <DIV ID="mainpage">
    <script language="JavaScript">


 © Coldbeans   Comments?

See also Other tips from Coldbeans.