J
Jamiil
Using Microsof Front Page, I am trying to display the time on the
Status Line, however, to no avail.
Here is a snip of the code code:
...\dev\JavaScript\DisplayTimeInStatusLine.js
<HTML>
<HEAD>
<script type="text/javascript">
//This function displays the time in the status line
//Invoke it once tho activate the clock; it will call itself from then
on.
function DisplayTimeInStatusLine(){
var d = new Date; //Get current time
var h = d.getHour; //Extract hours: 0 to 23
var m = d.getMinutes(); //Extract minutes: 0 to 59
var ampm = (h >= 12)?"PM":"AM"; //Is it am or pm
if(h > 12) h -= 12; //Convert 24-hour to 12-hour
if(h == 0) h = 12; //Convert 0 o'clock to midning
if(m < 10) m = "0" + m; //Convert 0 mins to 00 mins,etc
var t = h + ":" + m + ' ' + ampm; //Put it all together
defaultStattus = t; // Display it in the status line
// Arrange to do it all again in 1 min
setInterval(DisplayTimeInStatusLine(), 60000);
}
</SCRIPT>
</HEAD>
</HTML>
---------- end of snip 1 --------
...\dev\index.html
<head>
<!-- saved from url=(0014)about:internet -->
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Jamiil's Home Page</title>
<SCRIPT SRC="JavaScript/DisplayTimeInSatatusLine.js"></SCRIPT>
</head>
<body bgcolor="#000000" style="text-align: left"
onLoad="DisplayTimeInStatusLine();">
......
----- end of snip 2 -----
I am learning from a book called "JavaScript, The Definitive Guide, 3rd
Edition" by O'REILLY.
Can anyone help?
TIA
Status Line, however, to no avail.
Here is a snip of the code code:
...\dev\JavaScript\DisplayTimeInStatusLine.js
<HTML>
<HEAD>
<script type="text/javascript">
//This function displays the time in the status line
//Invoke it once tho activate the clock; it will call itself from then
on.
function DisplayTimeInStatusLine(){
var d = new Date; //Get current time
var h = d.getHour; //Extract hours: 0 to 23
var m = d.getMinutes(); //Extract minutes: 0 to 59
var ampm = (h >= 12)?"PM":"AM"; //Is it am or pm
if(h > 12) h -= 12; //Convert 24-hour to 12-hour
if(h == 0) h = 12; //Convert 0 o'clock to midning
if(m < 10) m = "0" + m; //Convert 0 mins to 00 mins,etc
var t = h + ":" + m + ' ' + ampm; //Put it all together
defaultStattus = t; // Display it in the status line
// Arrange to do it all again in 1 min
setInterval(DisplayTimeInStatusLine(), 60000);
}
</SCRIPT>
</HEAD>
</HTML>
---------- end of snip 1 --------
...\dev\index.html
<head>
<!-- saved from url=(0014)about:internet -->
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Jamiil's Home Page</title>
<SCRIPT SRC="JavaScript/DisplayTimeInSatatusLine.js"></SCRIPT>
</head>
<body bgcolor="#000000" style="text-align: left"
onLoad="DisplayTimeInStatusLine();">
......
----- end of snip 2 -----
I am learning from a book called "JavaScript, The Definitive Guide, 3rd
Edition" by O'REILLY.
Can anyone help?
TIA