我的这段代码为什么不能显示

yxqc 2004-10-20 05:37:09
<html><head><SCRIPT language=JavaScript>
var timerID = null;
var timerRunning = false;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock ()
{
stopclock();
showtime();
}
function showtime ()
{
var now = new Date();
var later = new Date("July 1 2003 00:00:00");
var days = (now - later ) / 1000 / 60 / 60 / 24;
var daysRound = Math.floor(days);
var hours = ( now - later) / 1000 / 60 / 60 - (24 * daysRound);
var hoursRound = Math.floor(hours);
var minutes = (now - later) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
var minutesRound = Math.floor(minutes);
var seconds = (now - later) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
var secondsRound = Math.round(seconds);

var oldtimeValue = daysRound + "天"
oldtimeValue += ((hoursRound < 10) ? "0" : "") + hoursRound
oldtimeValue += ((minutesRound < 10) ? "小时0" : "小时") + minutesRound
oldtimeValue += ((secondsRound < 10) ? "分0" : "分") + secondsRound+"秒"

document.clock.oldtimes.value = oldtimeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="72%" align=right bgcolor="#999999">今天是:
<SCRIPT language=JavaScript class=itm>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font style='font-size:9pt'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日 ",
d[today.getDay()+1],
"</font>" );
</SCRIPT>
         我们离开学校已经有∶</TD>
<FORM name=clock>
<TD width="28%" bgcolor="#999999"> 
<INPUT name=oldtimes id="oldtimes"
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-LEFT: 0px; COLOR: #000000; BORDER-BOTTOM: 0px"
size=25></TD>
</FORM>
</TR>
</TBODY>
</TABLE>
</body>
</html>
...全文
54 2 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yxqc 2004-10-21
  • 打赏
  • 举报
回复
楼上的你搞什么哦。
大家帮我看看了。
JK_10000 2004-10-20
  • 打赏
  • 举报
回复
<html><head><SCRIPT language=JavaScript>
var timerID = null;
var timerRunning = false;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock ()
{
stopclock();
showtime();
}
function showtime ()
{
var now = new Date();
var later = new Date("July 1 2003 00:00:00");
var days = (now - later ) / 1000 / 60 / 60 / 24;
var daysRound = Math.floor(days);
var hours = ( now - later) / 1000 / 60 / 60 - (24 * daysRound);
var hoursRound = Math.floor(hours);
var minutes = (now - later) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
var minutesRound = Math.floor(minutes);
var seconds = (now - later) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
var secondsRound = Math.round(seconds);

var oldtimeValue = daysRound + "天"
oldtimeValue += ((hoursRound < 10) ? "0" : "") + hoursRound
oldtimeValue += ((minutesRound < 10) ? "小时0" : "小时") + minutesRound
oldtimeValue += ((secondsRound < 10) ? "分0" : "分") + secondsRound+"秒"

document.clock.oldtimes.value = oldtimeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="72%" align=right bgcolor="#999999">今天是:
<SCRIPT language=JavaScript class=itm>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font style='font-size:9pt'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日 ",
d[today.getDay()+1],
"</font>" );
</SCRIPT>
         我们离开学校已经有∶</TD>

<TD width="28%" bgcolor="#999999"><FORM name=clock> 
<INPUT name=oldtimes id="oldtimes"
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-LEFT: 0px; COLOR: #000000; BORDER-BOTTOM: 0px"
size=25 value=123 ></FORM></TD>

</TR>
</TBODY>
</TABLE>
</body>
</html>
相关推荐
发帖
JavaScript

8.7w+

社区成员

Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
帖子事件
创建了帖子
2004-10-20 05:37
社区公告
暂无公告