setTimeout()?
qiuli 2005-12-02 01:12:15 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head><title>简单的动态时钟</title><head>
<body>
<script type="text/javascript">
function nowTime(){
var nowData = new Date();
var year = nowData.getYear();
var month = nowData.getMonth();
month += 1;
var day = nowData.getDate();
var hour = nowData.getHours();
var minute = nowData.getMinutes();
var second = nowData.getSeconds();
document.write(year+"年"+month+"月"+day+"日"+hour+"点"+minute+"分"+second+"秒");
setTimeout("nowTime()",1000);
}
nowTime();
</script>
</body>
</html>
运行时只刷了两次,没有动态更新时间的功能,提示错误是;缺少对象?
请帮我看看问题在哪,顺便可以讲解一下setTimeout()要注意的地方吗?