#42004/7/29 19:05:06
我写了这样的代码,响铃前执行正常,一响铃代码就被写白了。是啥毛病啊,请高手们帮改改:
<html>
<head>
</HEAD>
<BODY onLoad="run(); timerONE=window.setTimeout">
<SCRIPT LANGUAGE="javascript">
sungtime="65550PM" <!-- //设定响铃时间-->
timeID = null;
timeRunning = false;
function stop () {
if(timeRunning)
clearTimeout(timeID);
timeRunning = false;
}
function time () {
tick = new Date();
hours = tick.getHours();
minutes = tick.getMinutes();
seconds = tick.getSeconds();
current = ((hours >12) ? hours -12 :hours)
current += ((minutes < 10) ? "0" : "") + minutes
current += ((seconds < 10) ? "0" : "") + seconds
current += (hours >= 12) ? "PM" : "AM"
window.status=current;
if (current==sungtime){clock()};
timeID = setTimeout("time()",1000);
timeRunning = true;
}
function clock(){
document.write("<bgsound src='flourish.mid' loop=0>")
}
function run(){
stop();
time();
}
</SCRIPT>
</BODY>
</html>
编辑历史:[此帖最近一次被 allinhands 编辑过(编辑时间:2004-07-30 08:16:40)]