語法展示:: http://home.graffiti.net/rfvbhjko/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<center>
<script language="JavaScript">
<!--
function calendar()
{
var today,year,month,thisday,nDays;
today = new Date();
year = today.getYear() + 1900;
month = today.getMonth();
thisday = today.getDate();
if (month == 1) {
if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ){
nDays = 29;
} else {
nDays = 28;
}
} else if ((month == 3)||(month == 5)||(month == 8)||(month == 10)){
nDays = 30;
} else {
nDays = 31;
}
firstDay = today;
firstDay.setDate(1);
startDay = firstDay.getDay();
document.write("<TABLE BORDER=2 bordercolor=#8080FF CELLSPACING=2 CELLPADDING=2>");
document.write("<TR ALIGN=center>");
document.write("<TD><FONT SIZE=2 face=arial COLOR=\"#FF0000\">星期日</FONT>");
document.write("<TD><FONT SIZE=2 face=arial color=000000>星期一</FONT>");
document.write("<TD><FONT SIZE=2 face=arial color=000000>星期二</FONT>");
document.write("<TD><FONT SIZE=2 face=arial color=000000>星期三</FONT>");
document.write("<TD><FONT SIZE=2 face=arial color=000000>星期四</FONT>");
document.write("<TD><FONT SIZE=2 face=arial color=000000>星期五</FONT>");
document.write("<TD><FONT SIZE=2 COLOR=\"#FF0000\">星期六</FONT>");
document.write("<TR ALIGN=center>");
column = 0;
for (i=0; i<startDay; i++) {
document.write("<TD>");
column++;
}
for (i=1; i<=nDays; i++) {
document.write("<TD><FONT SIZE=2 color=000000>");
if (column == 0) document.write("<FONT COLOR=\"#FF0000\">");
if (column == 6) document.write("<FONT COLOR=\"#FF0000\">");
if (i == thisday) document.write("<B><U>");
document.write(i);
if (i == thisday) document.write("</U></B>");
if (column == 7||column == 0) document.write("</FONT>");
document.write("</FONT>");
column++;
if (column == 7) {
document.write("<TR ALIGN=center>");
column = 0;
}
}
document.write("</TABLE>");
}
-->
</script>
<CENTER>
<script language="JavaScript">
<!--
calendar();
-->
</script>
</center>
留言列表