我已经对此进行了一段时间的错误检查,但我仍然无法弄清楚出了什么问题。它应该记我的成绩,并吐出我的零用钱。它以前可以工作,但是 JSfiddle 把它搞砸了,现在它遇到了其他问题。谁能告诉我出了什么问题?代码:
<head>
<script>
alert('loaded');
function Runme() {
alert("running");
document.forms["form"].Runme();
var Mathematics = document.personal.Mathematics;
var OMathematics = document.personal.OMathematics;
var Sci = document.personal.Sci;
var OSci = document.personal.OSci;
var ELA = document.personal.ELA;
var OELA = document.personal.OELA;
var SS = document.personal.SS;
var OSS = document.personal.OSS;
var Elec1 = document.personal.Elec1;
var OElec1 = document.personal.OElec1;
var Elec2 = document.personal.Elec2;
var OElec2 = document.personal.OElec2;
var Elec3 = document.personal.Elec3;
var OElec3 = document.personal.OElec3;
var Elem1 = document.personal.Elec1;
var OElem1 = document.personal.OElec1;
var Elem2 = document.personal.Elec2;
var OElem2 = document.personal.OElec2;
var Elem3 = document.personal.Elec3;
var OElem3 = document.personal.OElec3;
var Owed = 0;
var Calc = function(n, o) {
if (n >= 90) {
Owed = Owed + 1;
if (n >= 95) {
Owed = Owed + 1;
}
}
else if (owed >= 80) {
Owed = Owed + 0.5;
}
if (n > o) {
Owed = Owed + 0.5;
}
if (n < o) {
if (n > 95) {
Owed = Owed - 0.25;
}
}
};
Calc(Mathematics, OMathematics);
Calc(Sci, OSci);
Calc(ELA, OELA);
Calc(SS, OSS);
Calc(Elec1, Elec1);
Calc(Elec2, Elec2);
Calc(Elec3, Elec3);
Calc(Elem1, Elem1);
Calc(Elem2, Elem2);
Calc(Elem3, Elem3);
alert(Owed);
};
</script>
</head>
<body>
<center>
<h1>Grade Calculator</h1>
<!--form name="form" action="grades.pl" onsubmit="return checkscript()"-->
<h5>Math</h5><input type=text size=20 name=Mathematics>
<h5>Old Math</h5><input type=text size=20 name=OMathematics>
<h5>Science</h5><input type=text size=20 name=Sci>
<h5>Old Science</h5><input type=text size=20 name=OSci>
<h5>English</h5><input type=text size=20 name=ELA>
<h5>Old English</h5><input type=text size=20 name=OELA>
<h5>Social Studies</h5><input type=text size=20 name=SS>
<h5>Old Social Studies</h5><input type=text size=20 name=OSS>
<h5>Elective One</h5><input type=text size=20 name=Elec1>
<h5>Old Elective One</h5><input type=text size=20 name=OElec1>
<h5>Elective Two</h5><input type=text size=20 name=Elec2>
<h5>Old Elective Two</h5><input type=text size=20 name=OElec2>
<h5>Elective Three</h5><input type=text size=20 name=Elec3>
<h5>Old Elective Three</h5><input type=text size=20 name=OElec3>
<h5>Elem One</h5><input type=text size=20 name=Elec3>
<h5>Old Elem One</h5><input type=text size=20 name=OElec3>
<h5>Elem Two</h5><input type=text size=20 name=Elec3>
<h5>Old Elem Two</h5><input type=text size=20 name=OElec3>
<h5>Elem Three</h5><input type=text size=20 name=Elec3>
<h5>Old Elem Three</h5><input type=text size=20 name=OElec3>
</form>
<br/>
<input type="button" value="Submit and Calculate" onClick="Runme()"/>
</center>
</body>