Reply to Re: howto: please wait, this may take a few seconds...

Your name:

Reply:


Posted by IWP506 on 09/26/26 11:27

Chung Leong wrote:
> There are a number of ways to do an asynchronous look up through
> Javascript. If you need something sophisticated, Google the web for
> AJAX libraries.
>
> A simple, cross-browser technique I've used before involves using
> setInterval() to periodically call a function, which then dynamically
> creates a <SCRIPT> tag linking in a PHP-generated script file. This
> script file would contain just a call to a function already defined,
> passing updated information from the server as parameter.
>
> You could also do it without Javascript. Just print out a message,
> perform the time-consuming task, then output a CSS style retroactively
> to turn off the message.
>
> Example:
>
> <div id="test">
> please wait, this may take a few seconds...
> </div>
> <?
>
> // time consuming task
>
> ?>
> <style>
>
> #test {
> display: none;
> }
>
> </style>
>
> The trick here is in keeping the browser from timing out and proper
> buffer flushing.

You want a flush() after your div so it becomes visible. Otherwise, it
defeats the purpose.

<div id="test">
please wait, this may take a few seconds...
</div>
<?
flush();
// time consuming task

?>
<style>

#test {
display: none;
}

</style>

[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

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