[Javascript] document.layers

Andrzej Wróblewski wroblewski at poczta.wprost.pl
Sun Nov 10 17:54:28 CST 2002


I'm foud this function and I have some question:

function show5(){
// what this means:  (!document.layers&&!document.all)
if (!document.layers&&!document.all)
return
 var Digital=new Date()
 var hours=Digital.getHours()
 var minutes=Digital.getMinutes()
 var seconds=Digital.getSeconds()
 var dn="AM" 
 if (hours>12){
 dn="PM"
 hours=hours-12
 }
 if (hours==0)
 hours=12
 if (minutes<=9)
 minutes="0"+minutes
 if (seconds<=9)
 seconds="0"+seconds
myclock="<font size='2' face='Arial' ><b><font size='1'>It's 
:</font></br>"+hours+":"+minutes+":"
 +seconds+" "+dn+"</b></font>"
// I don't uderstand the syntax: 
document.layers.liveclock.document.write
// Could anyone give another example pls.
if (document.layers){
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all)
// and what is this: liveclock.innerHTML=myclock how does it work
liveclock.innerHTML=myclock
setTimeout("show5()",1000)
 }


I know that's probably RTFM question but I looking in : 
http://developer.netscape.com/docs/manuals/communicator/jsguide4/
and I found nothing.

thnk U in advance for any comments
andrzej




More information about the Javascript mailing list