Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Showing page while still working...
January 30, 2008, 9:22 am
rate this thread
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 ?
<?php include("filehead.htm"); ?> // site header <head etc...
if (window.opener && !window.opener.closed)
alert("Parent window has been closed!");
echo "Searching for $searchfor, please wait...";
sleep(4); // I'd place something else here
Re: Showing page while still working...
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.
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 </table>)
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.
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
Just my 2 cent.