button onclick事件的实现问题

这笑容依然真实 2003-05-18 05:14:26
sub anything()
*****
end sub
*****
<*** type=button onclick="anything()">

我是这样做的,但是不对,请问,应该怎样做,谢谢~~!
...全文
58 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
好了,终于试出来了。。谢谢各位
  • 打赏
  • 举报
回复
啊,我改成这样了啊
<Script language=vbscript>
sub anything()
msgbox "ok"
end sub%>
</script>
<html>
<title>***</title>
<body>
<input type=button onclick="vbscript:anything()">
</body>
</html>
但还是提示类型不匹配'anything'
possible_Y 2003-05-18
  • 打赏
  • 举报
回复

<Script language=vbscript>
sub anything()
msgbox "ok"
end sub%>
</script>
<html>
<title>***</title>
<body>
<input type=button onclick="anything()">
</body>
</html>

不要写<% %>,那是服务器端的,客户端不能使用
  • 打赏
  • 举报
回复
改了,怎么还是提示:类型不匹配'anything'
心云意水 2003-05-18
  • 打赏
  • 举报
回复
啊,怎么粘贴了这么多……
心云意水 2003-05-18
  • 打赏
  • 举报
回复
回复人: socamp(camp-lai) ( ) 信誉:100 2003-05-18 18:49:00 得分:0


如果是这样的话,总是提示第5行错误啊。
<%@ language="vbscript"%>
<%sub anything()
msgbox "ok"
end sub%>
<%/script%>
<html>
<title>***</title>
<body>
<input type=button onclick="anything()">
</body>
</html>


回复人: socamp(camp-lai) ( ) 信誉:100 2003-05-18 18:49:00 得分:0


如果是这样的话,总是提示第5行错误啊。
<%@ language="vbscript"%>
<%sub anything()
msgbox "ok"
end sub%>
<%/script%>
<html>
<title>***</title>
<body>
<input type=button onclick="anything()">
</body>
</html>


回复人: socamp(camp-lai) ( ) 信誉:100 2003-05-18 18:49:00 得分:0


如果是这样的话,总是提示第5行错误啊。
<%@ language="vbscript"%>
<%sub anything()
msgbox "ok"
end sub%>
<%/script%>
<html>
<title>***</title>
<body>
<input type=button onclick="anything()">
</body>
</html>

我倒!你早贴出来大家就不走弯路了,你犯了根本性的错误!<%%>只见的文字是不会出现在客户端的!这么写当然是错的!
<%
response.write "sub anything()"
response.write "msgbox 'ok'"
response.write "end sub"
%>
  • 打赏
  • 举报
回复
如果是这样的话,总是提示第5行错误啊。
<%@ language="vbscript"%>
<%sub anything()
msgbox "ok"
end sub%>
<%/script%>
<html>
<title>***</title>
<body>
<input type=button onclick="anything()">
</body>
</html>
  • 打赏
  • 举报
回复
还是不行啊,在<input ***********>上加一个</script>马上就出问题了,而且下面也没有vbs语句了。
possible_Y 2003-05-18
  • 打赏
  • 举报
回复
不能
  • 打赏
  • 举报
回复
因为页面的问题,可以把<input ***********>放在<script language=VBScript>和
</script>之间吗?
possible_Y 2003-05-18
  • 打赏
  • 举报
回复
ie 6.0
  • 打赏
  • 举报
回复
你的ie是什么版本的呢?我的是5。0
possible_Y 2003-05-18
  • 打赏
  • 举报
回复
我试过,没有问题
  • 打赏
  • 举报
回复
用onclick="vbscript:anything()",提示:类型不匹配'anything'
心云意水 2003-05-18
  • 打赏
  • 举报
回复
<script language=VBScript>
sub anything()
msgbox "ok"
end sub
</script>
<input type=button onclick="anything()">

没有问题啊
possible_Y 2003-05-18
  • 打赏
  • 举报
回复
<script language="vbscript">
sub anything()
*****
end sub
*****
</script>
<*** type=button onclick="vbscript:anything()">
Reker熊 2003-05-18
  • 打赏
  • 举报
回复
<input type=button name=btn1>
<script language=VbScript>
Sub btn1_OnClick
...
End Sub
</script>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧