Reply to Re: Flushing outout to screen - ob_flush()

Your name:

Reply:


Posted by Jay on 01/23/06 02:48

this Javascipt is callin an eBay .dll file (searching for eBay items) -
that's why I want to output everything first, the call the javascript.

Without the script, the page runs perfect.

Have tried what you suggested, seems a bit faster, but not quite there ....
:(

I remember programming in C, where you could output to screen one line at a
time:

output line 1
output line 2
output line 3
etc ...

I'm thinking this should be possible in PHP

thanks


"J.O. Aho" <user@example.net> wrote in message
news:43imveF1nihpuU1@individual.net...
> Jay wrote:
>> I have a script that I want to output to the screen (browser) in 2 parts:
>> 1st part works fast (query of datbase and ouput to screen)
>> 2nd part performs a javascript action which takes time.
>
> Javascript is executed on the client browser, if it takes long time to
> execute, then the surfer should get a faster computer.
>
>
>> Is it possible to first output to screen the 1st part of the code (this
>> way
>> user has some information to look at)
>> then ... perform the javascript?
>
> If you would flush() the things in two parts, then you will only delay the
> time before the client gets the javascript and then they have to wait as
> long
> as now with that the javascript will be executed.
>
> <?PHP
> ob_start();
> echo "html";
> flush();
> echo "javascript";
> ob_end_flush();
> /* at this stage the javascript will begun to be executed */
> /* so the long wait will start now - better not save any */
> /* thing in the buffer and let everything go out at once */
> ?>
>
>
> //Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация