#!/usr/local/bin/tclsh8.3

puts "Content-type: text/html\n\n"



puts {
<HTML>
<HEAD>
<title>Web application 'monitor' demonstration</title>
</HEAD>
<BODY>    
<p id ="x1">Replace me.</p>
<P>[Show source code, explain DOM principles, ...]

<P>You need IE 5.5, Netscape 6, latest (?) Galeon, or Mozilla 0.9.5,
    or greater, to see this effect.  It is <em>not</em> available to
    current Opera, although there's discussion of its presence in a
    future release.

<P>It's not just textual display elements that can be updated this
   NO-REFRESH (to use the <a href = "http://www.macromedia.com/">Macromedia</a>
   rubric) way.  Graphical ...

<hr>This demonstration brought to you by <A HREF = "http://phaseit.net/">Phaseit, Inc.</A>


</body>
}

puts {<script language="JavaScript" type="text/javascript">
    myP=document.getElementById("x1");
    myTextNode=myP.childNodes[0];
    </script>
}      

flush stdout
while 1 {
   after 1000
   puts "<script>"
   puts "    myTextNode.data = 'The time at the server is [clock format [clock seconds]].'"
   puts "</script>"
   flush stdout
}

echo </html>           



# http://www.rlenter.com/stuff/server-monitor.html
# CSS 2--Opera?


# I've never found a good single source for this and have not bookmarked
# anything.  Most references will only point out differences between
# Netscape/Mozilla and IE.  I can find no useful documentation on the
# Opera web site.  


# The only mode in which I have done this in the past was for JavaScript
# roll-overs, like this one taken from my page at
# http://www.astrofoto.org/constellations/uma.html:
# 
# <a href="uma-large.html"
#    onmouseover='window.status="Ursa Major with Labels";uma.src="uma/20020316-1.0
#    1.0640.overlay";'
#    onmouseout ='uma.src="uma/20020316-1.01.0640";'><img src="uma/20020316-1.01.0
#    640"
#    name="uma"
#    border="2"
#    alt="Ursa Major and the Big Dipper" /></a>
# The trick is you need to name the image.  There are other tricks I
# have seen which involve preloading all the images into an array so
# they can be swapped faster.  This improves performance with some
# browsers.  In principle, if the URI expiration is some time in the
# future the browser shouldn't reload (but that is dependent on the
# browser settings), but some do anyway.      



# Right. Opera doesn't support anything that involves changing the
# text-flow in a document after it has been rendered. You can hide DIVs
# and make them visible, and even move them around, but you can't
# dynamically fill them or change the textual content. Except for the
# content of some form elements, as these don't affect the text flow.
# 
# See http://www.opera.com/docs/specs/ for more details.
# 
# Opera 7 (or whatever it will be called) is being worked on, which will
# allow dynamic insertion etc.       
