不是的,当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>
这是另外一个代码,这个好用的~,因为没有用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>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货