File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Waiting page while loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Waiting page while loading " Watch "Waiting page while loading " New topic
Author

Waiting page while loading

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi everybody!
Could you please tell me if there is a way to do a waiting page while the real one is loaded at all?
You know, when you press a submit button, the message "waiting...." appears while the form is processed and then the second page appear completely.. I mean, something that let the waiting message until the page is completely loaded.
Help me please,
Any clue will be great!
Thanks in advance,
Nancy.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
okay....here is an idea,,,,i used a button instead of a submit, all you need to do is add the on_click statement to you submit button. Pops up a layer on the page and says it is processing.
This is just a quick idea....see if it works and remember to change on_click to one word by removing the _.
<html>
<head>
<title>Ad</title>
</head>
<body>
<script>
function Advert(){
var wlayer="LoadingAlert";
var how="visible";
if (document.getElementById) {
document.getElementById(wlayer).style.visibility = how;
}
else if (document.all) {
document.all[wlayer].style.visibility = how;
}
else if (document.layers) {
document.layers[wlayer].visibility = how;
}
}
</script>
<div id="LoadingAlert" style="position:absolute;top:200;left:300;visibility:hidden;">
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#006F93" bgcolor="#C0C0C0">
<tr>
<td>
<p align="center"><b><font size="5">Please Wait while the form is processing.<br>
It will take a short moment of your time.<br>
Thank You!</font></b></td>
</tr>
</table>
</div>
<form>
<input type="button" on_click="Advert()" value="show it">
</form>
</body>
</html>
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thank you Al for your reply,
But, unfortunatly, it only works on IE and I need a solution that works either in IE or Netscape.
And it would be great if the first page dissapear (clear) while the message is shown.
Could you please help me?
Or dou you know where I could find clues to help me?
Thanks in advance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
change the div to something like this
<div id="LoadingAlert" style="position:absolute;top:0;left:0;visibility:hidden;width:100%;height:100%">
<table border='1' bordercolor="#006F93" bgcolor="000000" bgcolor="#C0C0C0" width="100%" height="100%">
<tr><td align="center" valign="middle">
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#006F93" bgcolor="#C0C0C0">
<tr>
<td>
<p align="center"><b><font size="5">Please Wait while the form is processing.<br>
It will take a short moment of your time.<br>
Thank You!</font></b></td>
</tr>
</table>
</td></tr>
</table>
</div>
you may be able to try the following to submit the form....might help with netscape...
<input type="button" on_click="Advert();formname.submit();" value="Submit Form">
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thanks againg Ian, but it still doesn't work in Netscape.
Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
If you are using CGI or Servlets to generate your content then try something like the following in pseudocode:

This solution uses client-pull to periodically check if the content is ready on the server. It is easier with Servlets where the HttpSession object can be used to track if the content is available yet.
HTH, Neil
[ September 26, 2002: Message edited by: Neil Laurance ]
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Hi Nancy,
the example I have was done using servlets but essentially any server side scripting process could produce it.
The process is done is 3 steps:
1) a page with the form parameters submits to an intermediate page
2) the intermediate page displays a message "please wait" and preforms a JavaScript location.replace to submit the parameters to the page which does the actual work.
3) the "work" page returns a result after a while
The key part is step 2 which only has the responsibility of displaying a message and forwarding the parameters on to the page the does the real work.
Anyway here is the code (listed in 3 servlets), you should be able to see what's going on.
Servlet1 (step1)

Servlet2 (step 2)

Servlet3 (step3)

Hopefully you get the idea, and yes this is browser independent.
James.
[ September 26, 2002: Message edited by: James Swan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Waiting page while loading
 
Similar Threads
Refresh a Web Page
http connection remain open and waiting for reciving nothing ... pleas
Before onload Event
Refresh a Web Page
PDF loading... please wait