不是的,当document.write的时候,你的这段script代码其实已经没有了,(document.write)没有将代码写回来
这是另外一个代码,这个好用的~,因为没有用document.write,<body onload="showtime()">
<span id="a"></span>
<script>
function showtime()
{
mdate=new Date(); 
myear=mdate.getYear(); 
mmonth=mdate.getMonth();
mmonth+=1; 
mday = mdate.getDate(); 
mweek=mdate.getDay(); 
mhour=mdate.getHours(); 
mminute=mdate.getMinutes(); 
msecond=mdate.getSeconds(); 
a.innerText = mmonth+" "+mday+" "+myear+" "+mhour+":"+mminute+":"+msecond; 
setTimeout("showtime()");
}
showtime();</script>
</body>