Showing page while still working...

Showing page while still working...

am 30.01.2008 10:22:51 von jodleren

Hi all

This is an idea of mine - a button will open this (using JS), which
then should open a window with some information - then continue
working. Idea - it may take some time, so this will process it, then
store data and pass it on to the parent window.
The idea works - only once done I get the onload - but I'd like to
have the page visible already at the flush when doing things (the
sleep as for now).
This is an idea of mine, which I hope will come to work.
Any ideas/ help ?

WBR
Sonnich


// site header


echo "Searching for $searchfor, please wait...";
echo "";
ob_flush();

sleep(4); // I'd place something else here
?>

Re: Showing page while still working...

am 30.01.2008 10:57:56 von Erwin Moller

jodleren wrote:
> Hi all
>
> This is an idea of mine - a button will open this (using JS), which
> then should open a window with some information - then continue
> working. Idea - it may take some time, so this will process it, then
> store data and pass it on to the parent window.
> The idea works - only once done I get the onload - but I'd like to
> have the page visible already at the flush when doing things (the
> sleep as for now).
> This is an idea of mine, which I hope will come to work.
> Any ideas/ help ?
>
> WBR
> Sonnich
>
>
> // site header >
>
>
> > echo "Searching for $searchfor, please wait...";
> echo "";
> ob_flush();
>
> sleep(4); // I'd place something else here
> ?>

Hi Sonnich,

That approach is doomed to give you all kinds of headaches.
I tried a lot of such funky stuff, and expect you'll run into all kind
of problems, like I did.
For example:
1) outputbuffering might still buffer even if you ob_flush()
(IIS does this for PHP)
2) Some browser refuse to start displaying untill document is in.
(Or more subtle, they refuse to display content of eg a table, untill
they see the )

Allthough I got some setups running and working, I always kept this
feeling: What will next version of IE/FF do? Or: Why does it work on
apache/nix, but not on IIS? Etc.
My advise is: Do not do it like that, even though you might get it up
and running in your development environment.

A much clearer way for you a programmer, and much more reliable way for
the end users, is using AJAX.
Since you rely on JavaScript anyway with your solution, AJAX should be
no objection.
EG, let JS poll every 5 seconds on the server asking if the task is
done, maybe saying which percentage is done in the meantime.
You don't even need a popup/popunder for that.
That way your solution will probably also work on next version of
IE/FF/webserver/etc.

Just my 2 cent.

Regards,
Erwin Moller

Re: Showing page while still working...

am 30.01.2008 11:12:20 von jodleren

On Jan 30, 11:57=A0am, Erwin Moller
wrote:
> jodleren wrote:
> > Hi all

> A much clearer way for you a programmer, and much more reliable way for
> the end users, is using AJAX.
> Since you rely on JavaScript anyway with your solution, AJAX should be
> no objection.
> EG, let JS poll every 5 seconds on the server asking if the task is
> done, maybe saying which percentage is done in the meantime.
> You don't even need a popup/popunder for that.
> That way your solution will probably also work on next version of
> IE/FF/webserver/etc.

Right...
I have earlier used some inline frames for similar stuff... and I
guess you might right, we had problems back then too.
I guess I have to read a bit about that.

Thanks
Sonnich

Re: Showing page while still working...

am 01.02.2008 11:03:28 von jodleren

On Jan 30, 11:57=A0am, Erwin Moller
wrote:
> jodleren wrote:
> > Hi all
>


> A much clearer way for you a programmer, and much more reliable way for
> the end users, is using AJAX.

Hi

Just wanted to thank you, I found some useful stuff and even found
something which makes my site work even better.
Thanks (AJAP - and PHP... :) )

/S