版主帮忙看一上错在哪里了?在线等
<SCRIPT LANGUAGE="JavaScript">var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = " " + ((hours >12) ? hours -12 :hours);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timeValue += (hours >= 12) ? " PM " : " AM ";
[bold]document.clock.face.value = timeValue;[/bold]
timerID = setTimeout("showtime()",1000);//设置超时,使时间动态显示
timerRunning = true;
}
function startclock () {
stopclock();
showtime();}
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}
//实现月历
function calendar() {
var m;
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = today.getYear() +1900;
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2) firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<table border='0' width='258' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'>");
document.write("<TR><td colspan='7' bgcolor='#ffffff' height='30' align='center' background='images/bj_02.jpg'>");
//var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
//var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var now = new Date();
var m = now.getMonth();
var m=m+1;
document.writeln("<FONT STYLE='font-size:12pt;Color:#ffffff font-weight: bold;'>"+":: " + now.getDate() + " " + m + " "+ now.getYear() + " " +"::" + "</FONT>");
document.write("</TD></tr></table>");
document.write("<TABLE style='border-right:1px solid gray #82D4FC;border-top:0px;border-left:1px solid gray #82D4FC;border-bottom:1px solid gray #82D4FC;' width='256' BORDER='0' CELLSPACING='0' CELLPADDING='0' BGCOLOR='#ffffff'><TR><TD>");
document.write("<table border='0' width='256' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'><TR><TD>");
document.writeln("</TH></TR><TR><TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Sun</FONT></TH>");
document.writeln("<th bgcolor='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Mon</FONT></TH>");
document.writeln("<TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Tues</FONT></TH>");
document.writeln("<TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Wed</FONT></TH>");
document.writeln("<TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Thu</FONT></TH>");
document.writeln("<TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Fri</FONT></TH>");
document.writeln("<TH BGCOLOR='#ffffff'><FONT STYLE='font-size:11pt;Color:#330066'>Sat</FONT></TH>");
document.writeln("</TR><TR>");
column = 0;
for (i=0; i<startDay; i++) {
document.writeln("\n<TD bgcolor='#FFFFFF'><FONT STYLE='font-size:9pt'></FONT></TD>");
column++;
}
for (i=1; i<=nDays; i++) {
if (i == thisDay) {
document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#FF8040'><FONT STYLE='font-size:9pt;Color:#ffffff'><B>")
}
else {
document.writeln("</TD><TD BGCOLOR='#ffffff' ALIGN='CENTER'><FONT STYLE='font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066'>");
}
document.writeln(i);
if (i == thisDay) document.writeln("</FONT></TD>")
column++;
if (column == 7) {
document.writeln("<TR>");
column = 0;
}
}
document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' BGCOLOR='#ffffff'>")
//document.writeln("<FORM NAME='clock' onSubmit='0'><FONT STYLE='font-size:9pt;Color:#ffffff'>")
document.writeln("</TD></TR></TABLE>")
document.writeln("</TD></TR></TABLE>");
}
</SCRIPT>
</head>
<body >
<table width="260" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="260">
<tr>
<td align="center" valign="middle"><script>calendar();</script></td>
</tr>
</table>
</body>
</html>
老是提示(document.clock.face.value = timeValue;)这一句为空或不是对象错误!