高手帮忙看看,为什么在firefox中onload失效
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>年月日联动</title>
<script type="text/javascript">
//年、月赋值
window.onload=function csh(){
var aYear=document.getElementById("s1");
var aMonth=document.getElementById("s2");
var aDay=document.getElementById("s3");
for(var i=1970;i<=2100;i++){
var op1=new Option(i,i);
aYear.add(op1);
}
for(var i=1;i<=12;i++){
var op2=new Option(i,i);
aMonth.add(op2);
}
aDay.length=0;
}
//判断闰年
function ryear(y){
if((y%4==0 && y%100!=0)||(y%400==0)){
return 0;
}else{
return 1;
}
}
//刷新日
function reday(){
var aYear=document.getElementById("s1");
var aMonth=document.getElementById("s2");
var aDay=document.getElementById("s3");
aDay.length=0; //清空
var op3=new Option("选择日","选择日");
aDay.add(op3);
var y=aYear[aYear.selectedIndex].value;
var m=aMonth[aMonth.selectedIndex].value;
if(m==2){
if(ryear(y)==0){
for(var i=1;i<30;i++){
op3=new Option(i,i);
aDay.add(op3);
}
}else{
for(var i=1;i<29;i++){
op3=new Option(i,i);
aDay.add(op3);
}
}
}else if(m==4||m==6||m==9||m==11){
for(var i=1;i<31;i++){
var op3=new Option(i,i);
aDay.add(op3);
}
}else{
for(var i=1;i<=31;i++){
var op3=new Option(i,i);
aDay.add(op3);
}
}
}
function f1(){
var aYear=document.getElementById("s1");
var aDay=document.getElementById("s3");
var aMonth=document.getElementById("s2");
var y=aYear[aYear.selectedIndex].value;
var m=aMonth[aMonth.selectedIndex].value;
if(m!="选择月" && y!="选择年"){
aDay.disabled=false;
}else{
aDay.disabled=true;
}
reday();
if(y=="选择年"){
aDay.length=0;
}
}
function f2(){
var aYear=document.getElementById("s1");
var aMonth=document.getElementById("s2");
var aDay=document.getElementById("s3");
var y=aYear[aYear.selectedIndex].value;
var m=aMonth[aMonth.selectedIndex].value;
if(m!="选择月" && y!="选择年"){
aDay.disabled=false;
}else{
aDay.disabled=true;
}
reday();
if(m=="选择月"){
var op3=new Option("选择日","选择日");
aDay.add(op3);
}
}
</script>
</head>
<body>
<select id="s1" onchange="f1()">
<option value="选择年">选择年</option>
</select>
<select id="s2" onchange="f2()">
<option value="选择月">选择月</option>
</select>
<select id="s3" disabled="true">
<option value="选择日">选择日</option>
</select>
</body>
</html>