Forum Moderators: open
I've tried using iframes. When I first experimented with an iframe going to a static page, the behaviour worked as expected. However, once I started going to dynamic content, i.e. servlet/JSP, my "waiting" image stayed on the page along w/ the report.
How do display the image and when the processing is complete, display my report in a new page without the image on the page? I'm sure this is covered in some FAQ or site, but have been unsuccessful in locating any info. I'd appreciate any help on this.
TIA,
Jim
Instead of having the form post directly to the script that is processing the request, have it post to another page. Design that page to look like the "please wait" but do a META REFRESH in that other page to the URL you were originally posting to with their form data in the querystring.
Then just modify your original posturl (if necessary) to request from the querystring instead of the form.
I think the question is: how to display an animated gif WHILE the process is running and how to make it dissapear after it's finished it's tasks...
<script language="JavaScript" type="text/javascript">
<!-- // Begin - put this in JS so that non-JS enabled browsers won't see it (requires JS to remove)
showLoadingPage();
// End -->
</script>
<!-- JSP/PHP/whatever -->
</body>
I think the question is: how to display an animated gif WHILE the process is running and how to make it dissapear after it's finished it's tasks...
That is exactly what I want to do.
To make things complicated, the script (a struts servlet) I'm calling returns a PDF in the form of a byte stream so the browser usually handles the mime type.
Maybe the way priceline and others do it is that the resulting page (the page that is processed) manipulates the surrounding objects (animated gif, text, etc), e.g. hides them. I'd think there would be some kind of pattern on doing this sort of thing.
Thanks to all that replied.
Jim
If the visitor hits it the first time, display the waiting page, start the processing, and set some attribute in the session.
If the request comes in again (has that attribute set), then check that session attribute - if the corresponding report is ready then display the report, if not - then display the same waiting page again.