转自http://bbs.blueidea.com/thread-1533182-1-1.html
function ts(t_month,t_year){
var count=0switch(t_month){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
count=31;
break;
case 4:
case 6:
case 9:
case 11:
count=30;
break;
case 2:
if(t_year%4==0)
count=29;
else
count=28;
if((t_year%100==0)&(t_year%400!=0))
count=28;
}
return count;
}
ndate=new Date();
alert(ts(ndate.getMonth(),ndate.getYear()));