CancelImage Upload

wrong code for current time display

From Guest User at 13:06:03 on the 28/06/2010.
Hi
this is wrong code what this url displayed is

this code given by the website is not working properly

the correct code is

in the body place this

<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="right"><span id="myClock">?</span>&nbsp;&nbsp;&nbsp;</td></tr>
</table>

place the following code in head section

<script type="text/javascript" language="javascript1.5">
window.onload = theClock
function theClock() {
now = new Date;
theTime = ((now.getHours() > 0 && now.getHours() < 13)) ? now.getHours() : (now.getHours() == 0) ? 12 : now.getHours()-12;
theTime += (now.getMinutes() > 9) ? ":" + now.getMinutes() : ":0" + now.getMinutes();
theTime += (now.getSeconds() > 9) ? ":" + now.getSeconds() : ":0" + now.getSeconds();
theTime += (now.getHours() < 12) ? " am" : " pm";
clockSpan = document.getElementById("myClock");
clockSpan.replaceChild(document.createTextNode(theTime),clockSpan.firstChild);
setTimeout("theClock()",1000);
}

</script>




Login
Want to login?

No problem. Just enter your email and password below.


register | home | reminder

Rate this thread:
1 2 3 4 5
myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com