下面是我在课本上的一到习题!根据学生的等级评A B C D级。
<script language="javascript">
document.write("<font size='+1'>");
while(true){
var score=eval(prompt("Please input the score:",""));
if (score<0 || score>100){
document.writeln("The score should be between 0 to 100!");
continue;
}
if(score>89 && score<101){
document.writeln("The degree is: A");
}
else if (score>79 && score<90){
document.writeln("The degree is: B");
}
else if(score>69 && score<80){
document.writeln("The degree is: c");
}
else if(score>59 && score<70);{
document.writeln("The degree is: D");
}
else {
document.writeln("It is bad!");
}
answer = prompt("Do you want to input another student?","");
if(answer !="y"){
break;
}
}
document.write("终于可以休息了...<br>");
</script>
我仔细的检查过上面的代码好几次了,都没发现什么错误啊!但是浏览的时候就是空白页,什么提示框都没有,真奇怪,请指教吧!呵呵