|
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
Navigation:
[Reply to this message]
|