D
Don Schmidt
Want to do an Ol Soul a favor and share your modified script?
At my age any time spent on R & D can be a significant impact on the time
remaining before I go to room temperature.
Don
dschmidt AT pacifier DOT com
At my age any time spent on R & D can be a significant impact on the time
remaining before I go to room temperature.
Don
dschmidt AT pacifier DOT com
Spike said:Don
BTW
This forum can cause a problem now and then
The width of text allowed will put a line break in the middle of a line
and render some scripts useless
as in the one you posted
document.write('<font size= 2 face= verdana><layer
and
id="clock"></layer><br>');
MUST be on one line
I think maybe one of the ones I posted to you had the same thing happen
and could be why they did not work for you
Spike
Don Schmidt said:At www.vanusa.org is where I have the script below with a running clock.
I'm tinkering to add the text on both ends of it to get to the script I'd
like to have
Don
<script language=Javascript1.2>
<!--
var tags_before_clock = " "
var tags_middle_clock = " "
var tags_after_clock = " "
if(navigator.appName == "Netscape") {
document.write('<font size= 2 face= verdana><layer
id="clock"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<font size= 2 face= verdana><span id="clock"></span>');
}
DaysofWeek = new Array()
DaysofWeek[0]="Sunday"
DaysofWeek[1]="Monday"
DaysofWeek[2]="Tuesday"
DaysofWeek[3]="Wednesday"
DaysofWeek[4]="Thursday"
DaysofWeek[5]="Friday"
DaysofWeek[6]="Saturday"
Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"
function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()
var col = ":";
var spc = " ";
var com = ",";
var apm;
if (date == 1 || date == 21 || date == 31)
{ender = "<sup>st</sup>"}
else
if (date == 2 || date == 22)
{ender = "<sup>nd</sup>"}
else
if (date == 3 || date == 23)
{ender = "<sup>rd</sup>"}
else
{ender = "<sup>th</sup>"}
if (12 < hrs) {
apm="<font size='-1'>pm</font>";
hrs-=12;
}
else {
apm="<font size='-1'>am</font>";
}
if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;
if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock);
document.clock.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML =
tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+ender+spc+month+com+spc+year+tags_after_clock;
}
}
setInterval("upclock()",1000);
//-->
</script>
Spike said:Don
I believe that the only way to have the clock update is to make the
script active with a body tag
Here is one that I modified:
You must add onLoad="showclock()" in <body ...> each time
you update the site, Yes it's a pain but then !!!
From the remarks you can see where I got the basic idea
For your use
Modify the two lines below between the " "
before="Hey Dude: it's"
after=" So there !"
to:
before="Buon giorno! È Sabato, "
after"="La sua visita è benvenuta!"
Edit the line containing:
font color='000999' face='verdana' size='4'
To the color, fone and size you want
==================================
Html code fragment folows
==================================
<script>
/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML
scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/
var dayarray=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new
Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
before="Hey Dude: it's"
after=" So there !"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000999' face='verdana'
size='4'><b>"+before+" "+dayarray[day]+", "+montharray[month]+"
"+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+", "+after+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function showclock(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}
</script>
<span id="clock"></span>
=====================================
end of code fragment
=====================================
As for your comment "fussy engineers need accuracy!, I retired after 41
years in the electronics field relating to air traffic control. Tell me
about it !
Having a clock that says the time is about Two Thirty in the afternoon
is a escape route TO sanity.
I will add this script to my page after I modify the www.mydomain.com
so I don't get locked out again
Spike