Annonceindlæg fra SuperOffice
06. januar 2006 - 14:13
#3
<script type="text/JavaScript"> function twoDigits(int){ return(int<10?"0"+int:int); } function doLongDate(){ dato=new Date(); aaaa=dato.getFullYear(); md=twoDigits(dato.getMonth()+1); dd=twoDigits(dato.getDate()); tt=twoDigits(dato.getHours()); mm=twoDigits(dato.getMinutes()); ss=twoDigits(dato.getSeconds()); document.getElementById("clock").innerHTML=dd+"-"+md+"-"+aaaa+" "+tt+":"+mm+":"+ss; } window.onload=function(){ doLongDate(); setInterval("doLongDate();",1000); } </script> ... <div id="clock"> </div>
06. januar 2006 - 14:31
#6
<script type="text/JavaScript"> function twoDigits(int){ return(int<10?"0"+int:int); } function doLongDate(){ dato=new Date(); aaaa=dato.getFullYear(); md=twoDigits(dato.getMonth()+1); dd=twoDigits(dato.getDate()); tt=twoDigits(dato.getHours()); mm=twoDigits(dato.getMinutes()); ss=twoDigits(dato.getSeconds()); document.getElementById("clock").innerHTML=tt+":"+mm+":"+ss; } window.onload=function(){ doLongDate(); setInterval("doLongDate();",1000); } </script> <div id="clock"> </div>
09. januar 2006 - 08:39
#8
<script type="text/JavaScript"> function twoDigits(int){ return(int<10?"0"+int:int); } function doLongDate(){ dato=new Date(); tt=twoDigits(dato.getHours()); mm=twoDigits(dato.getMinutes()); ss=twoDigits(dato.getSeconds()); document.getElementById("clock").innerHTML=tt+":"+mm+":"+ss; } window.onload=function(){ doLongDate(); setInterval("doLongDate();",1000); } </script> <div id="clock"> </div>
09. januar 2006 - 17:17
#10
>>mm12010 -- når du alligevel forbereder diven, kan du ligesågodt lave det xhtml-klart: document.getElementById("clock").firstChild.nodeValue = tt+":"+mm+":"+ss; -- så bliver i diven absolut nødvendig !-)