標題日期
將下列程式碼複製至<body>程式碼</body>之間。
<script language="javaScript"> <!-- isIE4 = (navigator.appVersion.charAt(0)>=4 && (navigator.appVersion).indexOf("MSIE") != -1); function window_onload() { for(i=0;i<j;i++) { sMessage=" " + sMessage;//台南市消防小北茶會許世力 } var iTimer = window.setInterval("MessageScroller()", iDelay); titleTime(); } function MessageScroller() { window.status=sMessage.substring(k,sMessage.length); k++; if (k==sMessage.length) {k=0;} } titleTime(); function titleTime(){ new String() sWeek=new String(7); sWeek[0]="日"; sWeek[1]="一"; sWeek[2]="二"; sWeek[3]="三"; sWeek[4]="四"; sWeek[5]="五"; sWeek[6]="六"; var Digital=new Date(); var year=Digital.getYear(); var month=Digital.getMonth()+1; var date=Digital.getDate(); var CWeek=sWeek[Digital.getDay()]; var hours=Digital.getHours(); var minutes=Digital.getMinutes(); var seconds=Digital.getSeconds(); if (minutes<=9) minutes="0"+minutes; if (seconds<=9) seconds="0"+seconds; document.title=year + "年" + month + "月" + date + "日 " + "星期" + CWeek + " " + hours + ":" + minutes + ":" + seconds; // + " " + dn; setTimeout("titleTime()",1000); } </script> |