asp调用javascript无反应的问题
我在asp网页里面调用javascript,之前是可以用的,可以显示时间,可是后来不知道设定了什么,结果就没有反应了,我的代码如下,谁知道可能是那些地方的原因呢?谢谢啦!!time.asp,date.js这两个文件在同一个文件夹里面
time.asp
程序代码:
<SCRIPT language=JavaScript src="date.js" type=text/JavaScript></SCRIPT> <script language="JavaScript" type="text/javascript"> <!-- document.write("<span id='clock'></span>"); var now,hours,minutes,seconds,timeValue; function showtime(){ now = new Date(); hours = now.getHours(); minutes = now.getMinutes(); seconds = now.getSeconds(); timeValue = hours + ":"; timeValue += ((minutes <10)?"0":"") + minutes+":"; timeValue += ((seconds <10)?"0":"") + seconds; clock.innerHTML = timeValue; setTimeout("showtime()",100); } showtime(); //--> </script> </font>date.js
程序代码:
var day=""; var month=""; var ampm=""; var ampmhour=""; var myweekday=""; var year=""; mydate=new Date(); myweekday=mydate.getDay(); mymonth=mydate.getMonth()+1; myday= mydate.getDate(); myyear= mydate.getYear(); year=(myyear > 200) ? myyear : 1900 + myyear; if(myweekday == 0) weekday=" 星期日 "; else if(myweekday == 1) weekday=" 星期一 "; else if(myweekday == 2) weekday=" 星期二 "; else if(myweekday == 3) weekday=" 星期三 "; else if(myweekday == 4) weekday=" 星期四 "; else if(myweekday == 5) weekday=" 星期五 "; else if(myweekday == 6) weekday=" 星期六 "; document.write(year+"年"+mymonth+"月"+myday+"日 "+weekday);