Re: howto: please wait, this may take a few seconds...
- From: "Chung Leong" <chernyshevsky@xxxxxxxxxxx>
- Date: 21 Sep 2005 21:42:19 -0700
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.
.
- Follow-Ups:
- References:
- howto: please wait, this may take a few seconds...
- From: Erwin Kloibhofer
- howto: please wait, this may take a few seconds...
- Prev by Date: Re: Printing through PHP on a UNIX system
- Next by Date: Re: Escaping Data and Replacing HTML for PHP/MySQL
- Previous by thread: howto: please wait, this may take a few seconds...
- Next by thread: Re: howto: please wait, this may take a few seconds...
- Index(es):
Relevant Pages
|
|