Archive
文章標籤 ‘ajax相關’
大頭恩之prototype.js學習手記(04)
2008年4月23日
1 則評論
大頭恩Prototype.js學習手記(03)
2008年4月23日
尚無評論
大頭恩之Prototype.js 學習手記(02)
2008年4月23日
尚無評論
使用setTimeout() 加 innerHtml屬性制作時鐘
2007年9月21日
1 則評論
<script language="JavaScript">
<!–
var now,hours,minutes,seconds,timeValue;
function showtime(){
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
timeValue = (hours >= 12) ? "下午 " : "上午 ";
timeValue += ((hours > 12) ? hours – 12 : hours) + " 點";
timeValue += ((minutes < 10) ? " 0″ : " ") + minutes + " 分";
timeValue += ((seconds < 10) ? " 0″ : " ") + seconds + " 秒";
clock.innerHTML = timeValue;
setTimeout("showtime()",1000);
}
showtime();
//–>
</script>
<body onload="showtime();" >
<span id=’clock’></span>
hours=now.getHours();,取得現在的時間,依次類推
Popularity: 15% [?]

近期迴響