做了一个考试时间控制,时间到弹出确定按钮,点击确定后提交试卷,可点了以后无反映,网页左下方出现了那种叹号,网页有错误,请问怎么回事?
<script language="Javascript">
var timer =10; //在这里设定考试时间,单位为秒。
function checkTime()
{
var timeNow = new Date();
var remnantTime = timeOver.getTime() - timeNow.getTime();
if(remnantTime < 1)
{
alert("时间到了,请交卷吧。");
document.Lesson.submit();
}
else
{
var msg = "";
var date1 = new Date();
date1.setTime(remnantTime);
msg = (date1.getTime() % 60000 == 0)?(Math.ceil(date1.getTime() / (60000)) + "分"):(Math.ceil(date1.getTime() / (60000))-1 + "分");
msg += date1.getSeconds() + "秒";
label1.innerText = msg;
}
setTimeout("checkTime();",1000);
}
function window_load()
{
startTime = new Date();
timeOver = new Date()
timeOver.setTime(startTime.getTime() + (timer * 1000));
checkTime();
}
window.onload = window_load; //网页加载完成开始计时
</script>
</head>
<body background=back.jpg>
离交卷还有:<span id="label1"></span>
<form action="score.aspx" id="Lesson">