问,我下面的一段ASP程序,返回值的时候如何将返回值加入表格(提示就有分)
将返回的窗口内容加在表格里面(规则的)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>1</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var ans = new Array;
var done = new Array;
var yourAns = new Array;
var score = 0;
ans[1] = "对";
ans[2] = "错";
ans[3] = "对";
ans[4] = "错";
ans[5] = "对";
ans[6] = "错";
function Engine(question, answer) {
yourAns[question]=answer;
}
function Score(){
var SecWin =
window.open("","scorewin","scrollbars,width=190,height=320")
var answerText = "看看你的成绩如何?\n";
for(i=1;i<=6;i++){
answerText=answerText+"\n-\n问题:"+i+"";
if(ans[i]!=yourAns[i]){
answerText=answerText+"\n答案:"+ans[i]+"";
}
else{
answerText=answerText+"对的";
score++;
}
}
answerText=answerText+"\n\n你的成绩是:"+score+"\n";
//now score the user
answerText=answerText+"\n结论 : ";
if(score<=0){
answerText=answerText+"你应该好好多学点了!";
}
if(score>=1 && score <=2){
answerText=answerText+"你还是有些知识欠缺的!";
}
if(score>=3 && score <=3){
answerText=answerText+"做的还不错,但还需要努力!";
}
if(score>4){
answerText=answerText+"哇,你可真是厉害,高手,高手!!";
}
SecWin.document.write(answerText);
}
// End -->
</script>
<b>Test your knowledge of Java!</b>
<hr>
<FORM>
<b>1. What is the name of the Java mascot?</b><br>
<input type=radio name="q1" value="对" onClick="Engine(1, this.value)"> 对<br>
<input type=radio name="q1" value="错" onClick="Engine(1, this.value)"> 错<br>
<b>2. Where is the best place to get Java software?</b><br>
<input type=radio name="q2" value="对" onClick="Engine(2, this.value)">对<br>
<input type=radio name="q2" value="错" onClick="Engine(2, this.value)">错<br>
<b>3. A 'for' loop in Java looks like this....</b><br>
<input type=radio name="q3" value="对" onClick="Engine(3, this.value)">对<br>
<input type=radio name="q3" value="错" onClick="Engine(3, this.value)">错<br>
<b>4. Which platform can not run Java.</b><br>
<input type=radio name="q4" value="对" onClick="Engine(4, this.value)">对<br>
<input type=radio name="q4" value="错" onClick="Engine(4, this.value)">错<br>
<b>5. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="对" onClick="Engine(5, this.value)">对<br>
<input type=radio name="q5" value="错" onClick="Engine(5, this.value)">错<br>
<b>6. Which platform can not run Java.</b><br>
<input type=radio name="q6" value="对" onClick="Engine(6, this.value)">对<br>
<input type=radio name="q6" value="错" onClick="Engine(6, this.value)">错<br>
<CENTER>
<input type=button onClick="Score()" value="看看我的成绩?">
</CENTER>
</FORM>
<p> </p>
</body>
</html>