ASP中怎样让网页的时间自动跟系统一起更新

来源:百度知道 编辑:UC知道 时间:2024/06/22 20:47:12
<marquee direction="left" scrolldelay="100" ><%response.write("你好!现在是:")%><%=now()%> </marquee>
怎样让它自动跟系统时间一样更新

<script language="javascript">
function showtime(){
currtime.innerText=new Date().toLocaleString();
setTimeout("showtime()",1000)
}

window.attachEvent("onload",showtime)
</script>
现在时间: <span id=currtime> </span>   星期日 </font>
不知道这是不是你要的效果?

可以的