中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-29 23:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » VBS脚本错误{已结} 查看 677 回复 3
楼 主 VBS脚本错误{已结} 发表于 2007-06-09 19:58 ·  中国 广东 广州 天河区 电信
中级用户
★★
积分 251
发帖 108
注册 2007-01-07 11:33
19年会员
UID 75721
性别 男
来自 湖南==>广州
状态 离线

<html>
<body>
<hr color="blue">
<input type="submit" name="btnl" value="click to test the code">
<script language="VBS">
<! - -
sub btnl _ onclick
dim message
message="hello world!"
msgbox message, 0, "tester result"
end sub
- - >
</script>
</body>
</html>

请问这段网页代码错在哪里.不能弹出hello world对话框``我才刚学VBS.

[ Last edited by Eblis on 2007-6-9 at 09:36 PM ]
DOS新人.多多指導
2 发表于 2007-06-09 20:48 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
积分 3,687
发帖 1,467
注册 2005-08-08 12:00
20年会员
UID 44210
状态 离线
<html>
<body>
<hr color="blue">
<input type="submit" name="btnl" value="click to test the code" onClick="btnl()">
<script language="VBScript">

sub btnl
dim message
message="hello world!"
msgbox message, 0, "tester result"
end sub

</script>
</body>
</html>
3 发表于 2007-06-09 21:34 ·  中国 广东 广州 天河区 电信
中级用户
★★
积分 251
发帖 108
注册 2007-01-07 11:33
19年会员
UID 75721
性别 男
来自 湖南==&gt;广州
状态 离线

<html>
<body>
<hr color="blue">
<input type="submit" name="button1" value="click to test the code">
<script language="VBS">
<!--
sub button1_onclick()
dim message
message="hello world!"
msgbox message, 0, "tester result"
end sub
-->
</script>
</body>
</html>

找到原因了....谢谢...

[ Last edited by Eblis on 2007-6-9 at 09:36 PM ]
DOS新人.多多指導
4 发表于 2007-06-09 22:14 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
积分 3,687
发帖 1,467
注册 2005-08-08 12:00
20年会员
UID 44210
状态 离线
试试这两个
<html>
<body>
<hr color="blue">
<input type="button" name="button" value="click to test the code 1" onClick="button('aaa!')">
<br>
<input type="button" name="button" value="click to test the code 2" onClick="button('bbb!')">
<script language="VBScript">

sub button(str)
msgbox str, 0, "tester result"
end sub

</script>
</body>
</html>


<html>
<body>
<hr color="blue">
<input type="button" name="button" value="click to test the code 1" onClick="button1('aaa!')">
<br>
<input type="button" name="button" value="click to test the code 2" onClick="button2('bbb!')">
<script language="VBScript">

sub button1(str)
msgbox str, 0, "tester result 1"
end sub

sub button2(str)
msgbox str, 0, "tester result 2"
end sub

</script>
</body>
</html>
论坛跳转: