如果是客户端显示当前时间:
<span id=sTime></span>
<script>setInterval("document.all.sTime.innerText=new Date().toLocaleString()",300)</script>
如果是在服务器显示当前时间:
<div id=testDiv></div>
<script language=vbscript>
dim t
t=cdate("<%=now()%>")
sub getTime()
t= t + cdate("00:00:01")
document.all.testDiv.innerHTML=t
end sub
call getTime()
call setInterval("call getTime",1000,"vbscript")
</script> |