|
Posted by Chung Leong on 10/10/39 11:27
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.
Navigation:
[Reply to this message]
|