dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Intermediate
Apr 28, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


'Wait Please...' Implementation

It is a common task for servlet (JSP) developers to have to display something with a server-based operation (calculation) that wastes a lot of time. Suppose you have a very long calculation and need to output some messages to users who are waiting for your servlet's results. Described below is one solution that deploys DHTML for solving this problem:
 
<html> 
<head> 
<style type="text/css"> 
    #waitpage { position: absolute; } 
    #mainpage { position: absolute; visibility: hidden; } 
</style> 

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

<body onLoad="init();"> 

  <DIV ID="waitpage"> 

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

  </DIV> 

  <!-- your very, very long calculation is here --> 
  <DIV ID="mainpage"> 
    <script language="JavaScript"> 
         location.href='http://your_host/servlet/your_servlet'; 
    </script> 
  </DIV> 

</body> 
</html> 
Dmitry Namiot
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date