网上复制过来的一段代码,就是搞不懂那儿报错.
<html>
<head>
<script language= "javascript ">
xx=new Date();
var s = (xx.getHours()*3600+xx.getMinutes()*60+xx.getSeconds());
var tim_d = parseInt(s/86400);
var tim_h = parseInt((s%86400)/3600);
var tim_m = parseInt(((s%86400)%3600)/60);
var tim_s = ((s%86400)%3600)%60;
function setime()
{
if(tim_s> =60)
{
tim_s = 0;//60
if(tim_m> =60)
{
tim_m=0;//60
//小时数
if(tim_h> =24)
{
window.clearTimeout(xx);
}
tim_h+=1;
}
tim_m += 1;
}
tim_s+=1;
if(tim_s <10)
{
show_s = "0 " + tim_s;
}
else
{
show_s = tim_s;
}
if(tim_m < 10)
{
show_m = "0 " + tim_m;
}
else
{
show_m = tim_m;
}
if(tim_h < 10)
{
show_h = "0 " + tim_h;
}
else
{
show_h = tim_h;
}
show_d = tim_d;
document.write(show_h+ "时 "+show_m+ "分 "+show_s+ "秒 ");
xx=setTimeout( "setime() ",1000);
}
</script>
<script language=javascript>
var key=1;
if(key==1){
setime();
}
</script>
<body>
</body>
</html>
主要还是想让时钟走动!
------解决方案-------------------- <html>
<head>
<script l