问个超级简单的VBscript,新人求解

来源:百度知道 编辑:UC知道 时间:2024/06/20 07:38:58
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>

<script language="vbscript">

<!--
sub bchange(choice)
if choice=1 then
document.bgcolor="red"
ElseIf
choice=2 then
document.bgcolor="blue"
end if
end sub
-->
</script>

</head>

<body>
<table border=3>
<tr><th>颜色<th>选择
<tr><td>红色<td><input type=radio onclick="bchange(1)">
<tr><td>蓝色<td><input type=radio onclick="bchange(2)"></tr>

</body>

</html>

老提示错误,说13行有错,还有26,27行类型不匹配,怎么改呢?

第13行不该换行。。。

写成
if choice=1 then
document.bgcolor="red"
ElseIf choice=2 then
document.bgcolor="blue"
end if
就对了。。。

26.27行我对网页调用一个过程的语法不明白。。。

刚刚百度了一下。。。解答如下

--------------------------------------------------------------------
正如楼上的楼上所说的,onclick只能调用客户端的函数,
换句话说onclick只能调用javascript写的函数,不能调用vbscript写的函数.
你要实现这个功能,将你的sub forcesubmit函数放在另外一个ASP文件b.asp中,然后onclick="location='b.asp'"
--------------------------------------------------------------------

哈哈 虎躯一震 2分走人。。。