RE: [PHP] Expedia.com
| From: | James Harrell | Date: | Wed, 09 Jun 2004 19:42:56 +0000 |
| Subject: | RE: [PHP] Expedia.com | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187969@lists.php.net to get a copy of this message | ||
Hi Rene,
Here's a thought- make your animated gif that's a "grow-bar"
that fills from left to right. Maybe it maxes out at 99% or
loops back around to 0 after reaching 100. :) Display this at
the top of the screen - but not within a table that is part of
the results display. More on why shortly.
Send about 256 characters of HTML (including the IMG SRC link
to your gif), then issue a flush(). At this point begin your
long-running query, displaying output as it becomes avialable.
Once the output is complete, issue a javascript that changes
the gif to a different one that's not animated (ex: 100%).
A few things to keep in mind:
- Some IE browsers won't display anything until 255 chars
have been output- hence the 256 number above.
- Some NS browsers won't display a portion of a table until
the entire table including closing tag has been written.
Hence, don't put your grow-bar inside a table unless it's
completed before issuing the long-running query.
Hope this helps,
james
>-----Original Message-----
>From: René Fournier [mailto:m5@renefournier.com]
>Sent: Wednesday, June 09, 2004 3:35 PM
>To: php
>Subject: [PHP] Expedia.com
>
>
>When Expedia.com is searching for flights, it displays a page with a
>little animated GIF progress bar, then display the results.
>
>How do they do that? How does the page sit idle until the query is
>finished, and then sends a new page with the results? I was thinking
>that they might use HTTP-REFRESH or something, and just keep hitting
>the database until the result is there. But is there a "best way" to do
>this? In my application, when the user clicks a certain button, it will
>take 10-20 seconds for the operation to complete—during that time I
>need the web browser to "waiit" for the data.
>
>I looked around for an article on this, but I'm not sure how to
>characterize this operation.
>
>...Rene
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>