Hi -
I am trying to use this script in a site, but the clock doesn't work in netscape - is there something I am missing in this that would make the script work in Netscape?
<script language="Javascript1.2">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - <!-- m --><a class="postlink" href="http://www.javascript-page.com">http://www.javascript-page.com</a><!-- m -->
var tags_before_clock = "<small>"
var tags_after_clock = "</small>"
if(navigator.appName == "Netscape") {
document.write('<layer id="clock"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="clock"></span><br>');
}
function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var col = ":";
var spc = " ";
var apm;
if (12 < hrs) {
apm="PM";
hrs-=12;
}
else {
apm="AM";
}
if (hrs == 0) hrs=12;
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+spc+apm+tags_after_clock);
document.clock.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML = tags_before_clock+hrs
+col+min+col+sec+spc+apm+tags_after_clock;
}
}
setInterval("upclock()",1000);
//-->
</script>
Thanks - also, does anyone have ideas about where to find a script with a pulldown menu that doesn't use the arrows to indicate that it drops down, but rather just automatically pulls down the menu when you mouse over it?
I am trying to use this script in a site, but the clock doesn't work in netscape - is there something I am missing in this that would make the script work in Netscape?
<script language="Javascript1.2">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - <!-- m --><a class="postlink" href="http://www.javascript-page.com">http://www.javascript-page.com</a><!-- m -->
var tags_before_clock = "<small>"
var tags_after_clock = "</small>"
if(navigator.appName == "Netscape") {
document.write('<layer id="clock"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="clock"></span><br>');
}
function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var col = ":";
var spc = " ";
var apm;
if (12 < hrs) {
apm="PM";
hrs-=12;
}
else {
apm="AM";
}
if (hrs == 0) hrs=12;
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+spc+apm+tags_after_clock);
document.clock.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML = tags_before_clock+hrs
+col+min+col+sec+spc+apm+tags_after_clock;
}
}
setInterval("upclock()",1000);
//-->
</script>
Thanks - also, does anyone have ideas about where to find a script with a pulldown menu that doesn't use the arrows to indicate that it drops down, but rather just automatically pulls down the menu when you mouse over it?