One simple technique I have used (first saw it in gifwizard.com in
1994)
is to output the html page to the browser
then open a
<script language="javascript">
and now you can keep streaming javascript commands
which can interact with dhtml dom and do anything
gifwizard used it to update a statusbar
<table id="statusBar" style="width:0px;" bgcolor="#ff0000">
<tr>
<td></td>
</tr>
<table>
statusBar.style.width = 10; //or something
statusBar.style.width = 20; //or something
statusBar.style.width = 30; //or something
etc.
although i usually use functions with very small names
like "s(1);" to keep the stream small
as long as you don't response.end the client will
keep an http connection open for a very long time
indeed
you can even clear the document and send
a new page if you want ... it works fine
obviously it might stress out the client
if the stream becomes too big over time!
hope that helps
John wrote:
Hi all,
I have an (well, what I think to be, at least) interesting question:
Is it possible to stream data down to the client and, after a certain amount
of data has been streamed, allow the client to begin interacting with that
data whilst still streaming data down?
Also, if it is possible, how would one go about coding this? Would some sort
of predfined bit of streaming be finished and notify the client (i.e. some
form of Javascript call after each section of streaming has completed)
Could someone please send me either some coding examples to begin with as a
starter or, more importantly, a few links to sites that have successfully
implemented this?
Thanks a lot in advance
Regards
John.