screamingeagle's response will only work if it is the building of the output that takes the time. Obviously, if it is a lengthy calculation followed by a quick display, nothing will be gained.
The method in the column is interesting, but maybe a little clunky for the user. (Either having to repeatedly reload, or wait for the auto-reload to realize its done).
If you want to get really fancy, you can try this:
page1 contains a hidden IFRAME (in I.E.) or FRAME (in Netscape) called hidden. You can detect the broswer in a bit of javascript at the bottom of your page and do a document.write of the appropriate container.
when the user submits the query, an onSubmit handler shunts the request to the hidden frame. I'm going to assume I.E. here, the code is similar for netscape:
document.all.hidden.src="calculation.html?...";

Then the handler exposes a hidden DIV (or ILAYER in netscape) containing the hold on message:
document.all.message.style.visibility='visible';

The handler returns false so that the page remains up. (You could also disable the submit button in here to prevent the user from repeatedly submitting the form while she's waiting).
return false;

The calculation script returns an empty page with an onload handler that redirects the top page to the results.
onLoad="top.document.location.href='results.html?...'

This assumes that the results are cached in a file or a session variable, or are simple enough to be passed through the request parameters.

All this is probably too complicated and too much effort to be of value, but it is an option. I've had to use it in the past.
Also, the flexibility of having a hidden communication channel in your web app comes in handy all over the place. The hidden frame can be used to silently update the server while the client is working. It can be used to log javascript errors in your server-side log files.

-pete
Entropy is not what is used to be.

In reply to Re: Re: Let users wait for the results by dreadpiratepeter
in thread Let users wait for the results by francesca

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.