<html><div style='background-color:'><DIV>
<P>Layers are NetScape positionable objects not undersatndable in IE</P>
<P>document.all is a script call on all document objects IE specific</P>
<P>document.layers is Netscape script, specific for the analog call of objects</P>
<P>the author is using it to disqualify the browsers other than IE & NS<BR><BR></P></DIV>
<DIV></DIV>
<DIV></DIV>>From: "Andrzej Wróblewski" <WROBLEWSKI@POCZTA.WPROST.PL>
<DIV></DIV>>Reply-To: javascript@LaTech.edu
<DIV></DIV>>To: javascript@LaTech.edu
<DIV></DIV>>Subject: [Javascript] document.layers
<DIV></DIV>>Date: Mon, 11 Nov 2002 00:54:28 +0100
<DIV></DIV>>
<DIV></DIV>>I'm foud this function and I have some question:
<DIV></DIV>>
<DIV></DIV>>function show5(){
<DIV></DIV>>// what this means: (!document.layers&&!document.all)
<DIV></DIV>>if (!document.layers&&!document.all)
<DIV></DIV>>return
<DIV></DIV>> var Digital=new Date()
<DIV></DIV>> var hours=Digital.getHours()
<DIV></DIV>> var minutes=Digital.getMinutes()
<DIV></DIV>> var seconds=Digital.getSeconds()
<DIV></DIV>> var dn="AM"
<DIV></DIV>> if (hours>12){
<DIV></DIV>> dn="PM"
<DIV></DIV>> hours=hours-12
<DIV></DIV>> }
<DIV></DIV>> if (hours==0)
<DIV></DIV>> hours=12
<DIV></DIV>> if (minutes<=9)
<DIV></DIV>> minutes="0"+minutes
<DIV></DIV>> if (seconds<=9)
<DIV></DIV>> seconds="0"+seconds
<DIV></DIV>>myclock="<FONT face=Arial size=2><B><FONT size=1>It's
<DIV></DIV>
<P>>:</FONT><BR>"+hours+":"+minutes+":" +seconds+" "+dn+"</B></FONT>" </P>
<P><STRONG><FONT face=Arial size=2>(THIS IS THE WAY YOU MERGE VAR OBJECT AND STRINGS INTO ONE SIMPLE TEXT STRING)</FONT></STRONG></P>
<P><STRONG><FONT face=Arial size=2>NOW myclock CONTAINS THE TIME STRING</FONT></STRONG></P>
<DIV></DIV>>// I don't uderstand the syntax:
<DIV></DIV>>document.layers.liveclock.document.write
<DIV></DIV>>// Could anyone give another example pls.
<DIV></DIV>>if (document.layers){
<DIV></DIV>>document.layers.liveclock.document.write(myclock)
<DIV></DIV>>document.layers.liveclock.document.close()
<DIV></DIV>>}
<DIV></DIV>>else if (document.all)
<DIV></DIV>>// and what is this: liveclock.innerHTML=myclock how does it work
<DIV></DIV>>liveclock.innerHTML=myclock
<DIV></DIV>>setTimeout("show5()",1000)
<DIV></DIV>> }
<DIV></DIV>
<P>> <FONT color=#000066>SO THE liveclock is the ID or the NAME of some ielement in the page f.i. DIV SPAN etc </FONT><FONT color=#000066>innerHTML=myclock, assigns the content of the string my clock to the html content of the element named liveclock somewhere inside the document BODY </FONT></P>
<P><FONT color=#000066>so to display this new content inside of this element you write the folwing in the script: liveclock.innerHTML=myclock </FONT></P>
<P> </P>
<DIV></DIV>>I know that's probably RTFM question but I looking in :
<DIV></DIV>>http://developer.netscape.com/docs/manuals/communicator/jsguide4/
<DIV></DIV>>and I found nothing.
<DIV></DIV>>
<DIV></DIV>>thnk U in advance for any comments
<DIV></DIV>>andrzej
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>Javascript mailing list
<DIV></DIV>>Javascript@LaTech.edu
<DIV></DIV>>https://lists.LaTech.edu/mailman/listinfo/javascript
<DIV></DIV></div><br clear=all><hr>Protect your PC - <a href="http://g.msn.com/8HMAEN/2024">Click here</a> for McAfee.com VirusScan Online </html>