新手网页编程问题

来源:百度知道 编辑:UC知道 时间:2024/09/28 12:07:54
<html>
<head>
<title>11111111</title>
</head>
<body>
<script Language =vbscript>
<!--
Sub judgeGrade(grade)
Document.write"你的成绩"&grade&":"
if grade>=90 Then
Document.write"优秀"
Else if grade>70 Then
Document.write"良好"
Else if grade>=60 Then
Document.write"通过"
Else
Document.write"未通过"
End if
End Sub
-->
</script>
<script language =vbscript>
<!--
Dim grade
grade = 77
judgeGrade(grade)
-->
</script>
</body>
</html>

运行后说 缺少if 还有 judgeGrade 不匹配
但我看好像没问题啊
希望高手帮我解决

Else if 之间没有空格应该是elseif这种格式

<html>
<head>
<title>11111111</title>
</head>
<body>
<script Language =vbscript>
<!--
Sub judgeGrade(grade)
Document.write"你的成绩"&grade&":"
if grade>=90 Then
Document.write"优秀"
Elseif grade>70 Then
Document.write"良好"
Elseif grade>=60 Then
Document.write"通过"
Else
Document.write"未通过"
End if
End Sub
-->
</script>
<script language =vbscript>
<!--
Dim grade
grade = 77
judgeGrade(grade)
-->
</script>
</body>