村居法律顾问工作总结:vbscript中怎么不能用alert
来源:百度文库 编辑:中科新闻网 时间:2024/05/11 17:11:37
<% @language=vbscript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<%
windows.alert("hello")
%>
</body>
</html>
上面这句代码错了吗,怎么提示为:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: ''
/index.asp,行10
我知道javascript是可以用alert的,但我看书上说的vbscript也是可以用这个alert的啊
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<%
windows.alert("hello")
%>
</body>
</html>
上面这句代码错了吗,怎么提示为:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: ''
/index.asp,行10
我知道javascript是可以用alert的,但我看书上说的vbscript也是可以用这个alert的啊
用是可以用,要加脚本封闭标签,输出脚本到客户端,如果放到<%%>内,就这样~
<% @language=vbscript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<%
response.write "<script language='vbscript'>"
response.write "alert(""hello"")"
response.write "</script>"
%>
</body>
</html>
-------------------------------------------
写在html里:
<script language='vbscript'>
alert("hello")
</script>
vbscript是用MSGBOX吧
楼上的,好像不是弹出窗口而是直接在网页上显示的
vb里面可以调用js的代码:
方法:response.write("<script>JS代码</script>")
这个弹出窗口:
response.write("<script>alert('hello!')</script>")