Re: [PHP] Expedia.com

2004-06-13 Thread Rainer Mller
Red Wingate wrote:
Allmost, after having a quick look at the source i tell you they
do it like that:
div id=loading style=display:block
... loading stuff here ...
/div
. page loading here 
done?
JS: document.getElementByid('loading').display='none';
take a look for yourself :-)
The idea is great IMHO. But what if someone has javascript disabled?
Rainer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Expedia.com

2004-06-09 Thread René Fournier
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 completeduring 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


RE: [PHP] Expedia.com

2004-06-09 Thread James Harrell
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:[EMAIL PROTECTED]
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 completeduring 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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Expedia.com

2004-06-09 Thread Red Wingate
Allmost, after having a quick look at the source i tell you they
do it like that:
div id=loading style=display:block
... loading stuff here ...
/div
 page loading here 
done?
JS: document.getElementByid('loading').display='none';
take a look for yourself :-)
James Harrell wrote:
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:[EMAIL PROTECTED]
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 completeduring 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Expedia.com

2004-06-09 Thread Michal Migurski
 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 completeduring that time I need
 the web browser to waiit for the data.

The progress bar goes by too quickly for me to tell, but perhaps they are
using a slow-loading resource someplace on the page? E.g., an image whose
content-length is 64, whose 64th byte does not get sent by the server
until the query is complete. Combine that with a bit of javascript waiting
for the image to load, and you should have basic loading-bar behavior.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Expedia.com

2004-06-09 Thread René Fournier
I guess a better question would be, what is the best practices way of 
showing a Please wait... page while a server operation is performed 
(which could take 5 or 45 seconds), then make the page display the 
resulting data (via reload, or slow-load, or whatever)? Would love to 
find an article on this.

...Rene
On Wednesday, June 9, 2004, at 05:56 PM, Michal Migurski wrote:
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 completeduring that time I 
need
the web browser to waiit for the data.
The progress bar goes by too quickly for me to tell, but perhaps they 
are
using a slow-loading resource someplace on the page? E.g., an image 
whose
content-length is 64, whose 64th byte does not get sent by the server
until the query is complete. Combine that with a bit of javascript 
waiting
for the image to load, and you should have basic loading-bar behavior.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php