標題列日期 - 在標題上顯示出現在的日期。
請將以下程式碼貼到<body>與</body>之間:
<script type="text/javascript">
<!--
var isnMonth = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"); var isnDay = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
today = new Date () ;
yd = today.getYear();
if (yd < 2000) {yd = yd + 1900};
yudan = today.getDate();
document.title="今天是: "+yd+"年"+isnMonth[today.getMonth()]+yudan+"日"+isnDay[today.getDay()];
//
-->
</script>
沒有留言:
張貼留言