in reply to Generating a 'please wait' message

First, at the beginning of your script (after use strict; :), autoflush your output buffer:
$|++;

Second, I suggest your output page watches it's HTML. It's easy to create a page that displays a "This page may take 10 seconds to load, please be patient" message at the top, just as long as a TABLE tag is not waiting for the script output to finish rendering.

For an example, go to any slashdot page with 300 comments on it. The banner ad loads quickly, the rest renders when ALL comments have loaded (ie, the TABLE they are in finishes loading).

For longer waits, you might want to look at setting up a child process that whacks output to a static file, with auto-refresh on your 'please wait' page to check status and display when complete. (not 100% on easiest way to do this, ie "forked if I know (sic) ... oh well :)

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Generating a 'please wait' message
by nysus (Parson) on Apr 12, 2001 at 23:42 UTC
    I see what you are saying with "watching the HTML". Unfortunately, the HTML code generated by the script is in a table cell that runs the entire length of the page. It sounds like your second soltution may offer a possibility...and something else I need to learn!
      Why not split your HTML into two batches? It would be easy for you to add a "please wait" table to the top of your page and then the rest underneath - heck, if layout is important, why not split your existing table into two - with the first half containing the 'wait' message? I'm sure you could work it out!

      "It sounds like your second solution may offer a possibility.." - don't make life complicated if you don't need to!

      cLive ;-)

      You can often avoid using HTML tables by using Cascading Style Sheets instead. I used to try and do this a lot, and it worked great with the Internet Explorer and Opera browsers.

      The problem is that Netscape 4.x does not really support stylesheets in a meaningful way. So while IE and Opera users would see my page, Netscape 4.x users would get a blank page.

      Several years ago there were a lot of complaints about Netscape's inadequate support for CSS. I do not know whether they have fixed the problem.

      But I would say consider using CSS instead of tables to format your output, and then see whether any Netscape browser versions that you wish to support have fixed Netscape's CSS problems.