Click to See Complete Forum and Search --> : Frames and Counting Clock


yowebtom
08-25-2003, 11:04 AM
I am trying to get a document title clock to work in frames from the javascript code. Any help would be great. Here is the frames code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Commissions Launch page</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4926.2500" name=GENERATOR></HEAD>
<FRAMESET rows=15,85 frameborder="0" framespacing="0">
<FRAME border=0 name=banner marginHeight=5 src="commtitle.htm">

<FRAMESET cols=45%,* frameborder="0" framespacing="0">
<FRAME name=left marginWidth=0 marginHeight=0 src="menufr.htm" >
<FRAME name=main marginWidth=0 marginHeight=0 src="commhome.htm" >
</FRAMESET>

</FRAMESET></HTML>

followed by the titlebarclock logic:

<!-- THREE STEPS TO INSTALL TITLE BAR CLOCK:

1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Alex Jarvis (gamemastax@hotmail.com ) -->
<!-- Begin
function clock() {
var date = new Date()
var year = date.getYear()
var month = date.getMonth()
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
var months = new Array("", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC")

var monthname = months[month]

if (hour > 12) {
hour = hour - 12
}

if (minute < 10) {
minute = "0" + minute
}

if (second < 10) {
second = "0" + second
}


document.title = "JSS - " + monthname + " " + day + ", " + year + " - " + hour + ":" + minute + ":" + second

setTimeout("clock()", 1000)

}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad="clock()">

<!-- STEP THREE: Copy this code into the BODY of your HTML document -->

The script is running in the title bar!!

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.53 KB -->

Khalid Ali
08-25-2003, 12:27 PM
please elaborate a bit more that what is yoru question.

yowebtom
08-25-2003, 02:18 PM
document.title = "JSS - " + monthname + " " + day + ", " + year + " - " + hour + ":" + minute + ":" + second

The above line works fine in a NON-frames html document. It will not change the title in a html document that uses frames.

attached is the code i am trying to get to work with frames.
commtitletrial.htm works - just single html file
Commissions LaunchTrial.htm does not work (in frames)

thanks