Hello,
I would like to put a simple text clock on a page.
All material i found are clocks in fields, rarely on a layer.
I finally worked with a script that displays text clock in a cell.
Works fine in Msie, not on netscape.
If someone can recommand an Url with a simple text clock in a cell or look at the code below:
<TD BGCOLOR="#F2FFBF" WIDTH="100" ID="clok"> <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function clock() {
if (!document.clok && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "am";
if (hours > 11) amOrPm = "pm";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
("<FONT CLASS='fontBody'>"
;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
("</FONT>"
;
if (document.clok) {
document.clok.document.write(dispTime);
document.clok.document.close();
}
else
if (document.all)
clok.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// End -->
</SCRIPT></TD>
Do you know why netscape doesn't recognize this and even don't send me a Js error ?
BY the way i would like to apply a certain font style to the text displayed say: fontbody.
I don't know the way to insert this in the write command. This style doesn't work in msie either.
Thanks a lot for your incomming messages.
Habblablow.
I would like to put a simple text clock on a page.
All material i found are clocks in fields, rarely on a layer.
I finally worked with a script that displays text clock in a cell.
Works fine in Msie, not on netscape.
If someone can recommand an Url with a simple text clock in a cell or look at the code below:
<TD BGCOLOR="#F2FFBF" WIDTH="100" ID="clok"> <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function clock() {
if (!document.clok && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "am";
if (hours > 11) amOrPm = "pm";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
("<FONT CLASS='fontBody'>"
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
("</FONT>"
if (document.clok) {
document.clok.document.write(dispTime);
document.clok.document.close();
}
else
if (document.all)
clok.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// End -->
</SCRIPT></TD>
Do you know why netscape doesn't recognize this and even don't send me a Js error ?
BY the way i would like to apply a certain font style to the text displayed say: fontbody.
I don't know the way to insert this in the write command. This style doesn't work in msie either.
Thanks a lot for your incomming messages.
Habblablow.