PDA

View Full Version : Extremely 2 problems...need help!!!



kkcheah
05-26-2005, 05:26 AM
I'm beginner on design web so need help on it. I have 2 problems. Firstly, How do I make it compatible with all browser in Window (Opera, Mozilla, Firefox, and other) , MAC & Linux. I only the Date & Time only.

This is source code below:

<html>


<SCRIPT language="Javascript1.2">

var tags_before_clock = "<p align='right'><b><font face='verdana' size='1' color='#3366FF'>"
var tags_middle_clock = "at"
var tags_after_clock = "</font></b></p>"

if(navigator.appName == "Netscape") {
document.write('<layer id="clock"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<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][/I]="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 = "st"}
else
if (date == 2 || date == 22)
{ender = "nd"}
else
if (date == 3 || date == 23)
{ender = "rd"}

else
{ender = "th"}

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+da y+month+hrs+col+min+col+sec+apm+spc+tags_middle_cl ock+spc+day+spc+month+spc+date+ender+spc+year+tags _after_clock);
document.clock.document.close();
}

if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML = tags_before_clock+day+month+spc+date+ender+spc+yea r+spc+tags_middle_clock+spc+hrs+col+min+col+sec+ap m+spc+tags_after_clock;
}
}

setInterval("upclock()",1000);

</SCRIPT>

</html>


__________________________________________________ ______________

Secondly, On each parent menu that expand under submenu (e.g window directory that has many subdirectory but in web base), so program that create that used this format in vertical bar that in left side?


Thanks,
Joseph