我从 JSLint 收到以下错误,但我无法理解:
-所有问题都已回答-
对这些有任何帮助吗?
use /*jslint browser: true, devel: true */
function submit() {
"use strict";
document.forms.form.submit();
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 Owed = 0;
function calc(n, o) {
if (n >= 90) {
Owed = Owed + 1;
if (n >= 95) {
Owed = Owed + 1;
}
}
else if (o >= 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);
alert(Owed);
}
这是上下文中的代码:http: //jsfiddle.net/Aidoboy/AdzwC/
正在使用的异常:“每个函数有许多 var 语句”和“混乱的空白”