A question came up on comp.lang.tcl about a CGI which gave continuous updates to a Netscape browser. The original question had to do with a problem where Netscape stayed busy even after the CGI was finished (which was about two hours(!) after its started). This evolved into a discussion of how to get page updates that would mimic a real-time monitor without resorting to the use of Java.
[*] BR: Actually in my experience, you can also send scripts after the closing </body> and </html> and the browser will evaluate it.
Here is a complete example which replaces the second paragraph (identified via the id=x1 tag) with new information which is then updated periodically. You can view the page via http://www.rlenter.com/stuff/server-mon2.html .
[CL needs to explain some of the applications of the technique.]
Examples currently work with: IE 5.5 and 6, Netscape 6, Mozilla 0.9.5, ...
Examples do not work with: Netscape 4, Opera 6, ...
Arjen Markus: I have been experimenting with something akin to this - using the browser as a device for "on-line visualisation". That is, a long-running computation produces an output file, a plotting program produces a GIF-file from the last record in the output file and the browser regularly checks if there is a new picture. It is not fool-proof as yet, but the principle seems to work.
CL responds that, yes, there are both browser-pull and server-push applications of the technique. Its kernel, to my mind, has to do with DOM navigation or computation. A few more comments appear in [L2 ].
[email protected]: This is a cool idea. I have been working with a similar concept to update a controller page with small agent.php windows that send data back to a controller page while running in the background. I made a mini test using straight html: http://www.nectechmedia.com/auct.sample/controller.htm
still buggy but, works- Matt
BR: One gotcha that I remember is that some (all?) browsers assume a server timeout after something like 5 minutes even if they get new data all the time.
<meta http-equiv="refresh" content="10">
With that you have to re-create the whole page, though.