问答详情
源自:7-23 编程练习

各位大神,请问下面的编码哪里出错了呢?(js进阶篇 7-23编程练习)

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>系好安全带,准备启航</title>

<script type="text/javascript">

var d=new date;

var c=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

document.write(d.getFullYear()+"年"+d.getMonth()+"月"+d.getDate()+"日 "+c[d.getDay()]);

var b="小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";    

var e=b.spilt(";"); 

var sum=0;    

for(var i=0;i<e.length;i++){       

sum=sum+parseInt(e[i].substring(3,5));  

}    

document.write("--班级总分为:"+sum);

</script>

</head>

<body>

</body>

</html>


提问者:qq_我本非凡_1 2017-04-03 12:04

个回答

  • QQ_随意
    2017-04-03 12:36:00
    已采纳

    var e=b.spilt(";");的spilt改为split

  • QQ_随意
    2017-04-03 12:25:39

    var d = new Date();