note 87084 added to function.flush
| From: | BrianGuire at osu1 dot php dot net | Date: | Tue, 18 Nov 2008 22:36:43 +0000 |
| Subject: | note 87084 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146676@lists.php.net to get a copy of this message | ||
Situation: wanted to use a SPAN as a status tracker while my script executed, using javascript. I
got the flush part right in PHP but it still wasn't working. Then I tried putting each
javascript statement in its own block and that worked. Apparently the browsers buffer javascript
blocks and don't refresh the page until the block is tied off. So if you ever want to do
something like what I've described, instead of doing this:
<?
echo "<script type=\"text/javascript\">\n";
// processing
echo "setStatus('Did this...');\n";
// more processing
echo "setStatus('Did that...');\n";
// still more processing
echo "setStatus('Done');\n</script>\n";
?>
Do this:
<?
echo "<script type=\"text/javascript\">setStatus('Did
this...');\n</script>\n";
// processing
echo "<script type=\"text/javascript\">setStatus('Did
that...');\n</script>\n";
// more processing
echo "<script
type=\"text/javascript\">setStatus('Done');\n</script>\n";
?>
----
Server IP: 69.147.83.197
Probable Submitter: 66.210.181.98
----
Manual Page -- http://www.php.net/manual/en/function.flush.php
Edit -- https://master.php.net/note/edit/87084
Del: integrated -- https://master.php.net/note/delete/87084/integrated
Del: useless -- https://master.php.net/note/delete/87084/useless
Del: bad code -- https://master.php.net/note/delete/87084/bad+code
Del: spam -- https://master.php.net/note/delete/87084/spam
Del: non-english -- https://master.php.net/note/delete/87084/non-english
Del: in docs -- https://master.php.net/note/delete/87084/in+docs
Del: other reasons-- https://master.php.net/note/delete/87084
Reject -- https://master.php.net/note/reject/87084
Search -- https://master.php.net/manage/user-notes.php