HTML组件--COMPONENTS ===CALENDAR HTC===
时间:2013-2-17 编辑:邢台网络公司
<HEAD>
<?IMPORT NAMESPACE="ANYDAY" IMPLEMENTATION="day.htc"/>
<?IMPORT NAMESPACE="TODAY" IMPLEMENTATION="today.htc"/>
<PUBLIC:COMPONENT tagName="CALENDAR">
<ATTACH EVENT="oncontentready" ONEVENT="fnInit()"/>
</PUBLIC:COMPONENT>
<SCRipT LANGUAGE="javaScript">
<!--
function fnInit() {
defaults.viewLink = document;
}
// -->
</SCRIPT>
<STYLE>
TD {
background-color:tan;
width:50;
height:50;
}
</STYLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="Javascript">
<!--
// Copyright 1997 -- Tomer Shiran
setCal();
function leapYear(year) {
if (year % 4 == 0) {// basic rule
return true; // is leap year
}
/* else */ // else not needed when statement is "return"
return false; // is not leap year
}
function getDays(month, year) {
// create array to hold number of days in each month
var ar = new Array(12);
ar[0] = 31; // January
ar[1] = (leapYear(year)) ? 29 : 28; // February
ar[2] = 31; // March
ar[3] = 30; // APRil
ar[4] = 31; // May
ar[5] = 30; // June
ar[6] = 31; // July
ar[7] = 31; // August
ar[8] = 30; // September
ar[9] = 31; // October
ar[10] = 30; // November
ar[11] = 31; // December
// return number of days in the specified month (parameter)
return ar[month];
}
<<1
23>>>