输出有问题,望能指正问题在那儿
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全带,准备启航</title>
<script type="text/javascript">
var today = new Date();
var month = today.getMonth() + 1 +"月";
var week = ["星期一","星期二","星期三","星期四","星期五","星期六","星期日"];
document.write(today.getFullYear()+"年"+month+today.getDate()+"日"+" "+week[today.getDay()]);
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var scoreArr = scoreStr.split(";");
var average;
var num;
for (var i=0;i<scoreArr.length;i++){
var index = scoreArr[i].indexOf(':')+1;
num += parseInt(scorArr[i].substr(index));
average = num/soreArr.length;
}
document.write("--班级总分为:"+average);
</script>
</head>
<body>
</body>
</html>
现在只能正确输出日期,最后一个document.write语句的内容都不输出。试过将for循环注释掉之后会输出”--班级总分为“,但是实在找不到循环体的问题在哪里了。。。