最初的学者

asp20003 2003-10-31 08:08:49
刚学ASP,请问怎样在网页上设分秒会跳动的时钟,不是刷新分秒改变的那种啊。
注:用VBSCRIPT!
谢了!
...全文
19 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
asp20003 2003-11-01
  • 打赏
  • 举报
回复
先谢了。
有没有VBSCRIPT???
possible_Y 2003-10-31
  • 打赏
  • 举报
回复
<script language="JavaScript">
var timerID = null
var timerRunning = false
function MakeArray(size) {
this.length = size;
for(var i = 1; i <= size; i++)
{
this[i] = "";
}
return this;
}
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function showtime (){
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var day = now.getDay();
Day = new MakeArray(7);
Day[0]="SUN.";
Day[1]="MON.";
Day[2]="TUE. ";
Day[3]="WED.";
Day[4]="THU.";
Day[5]="FRI.";
Day[6]="SAT.";
var timeValue = "";
timeValue += year + "-";
timeValue += ((month < 10) ? "0" : "") + month + "-";
timeValue += date + "日 ";
timeValue += (Day[day]) + " ";
timeValue += ((hours <= 12) ? hours : hours - 12);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timeValue += (hours < 12) ? "AM " : "PM ";
document.all.clock.innerText = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true
}
function startclock () {
stopclock();
showtime()
}
</script>
<body onload="startclock()">
<div id="clock"></div>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧