|
像 msgbox() 这样直接与浏览者交互的 vbscript 函数是不能在服务器段运行的,而是需要在客户端运行的。因此,就分有服务器端脚本和客户端脚本的区别。
服务器端脚本使用 <% %> 括起来,而客户端脚本则使用下面的形式括起来: <script language = "vbscript"
vbscript 客户端脚本
</script>
示例代码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<[email=%@LANGUAGE=]%@LANGUAGE="VBSCRIPT[/email]" CODEPAGE="65001" %>
<% response.Write("服务器端代码执行") %>
<script language="vbscript">
choice = msgbox("点击 YES 或 NO", vbYesNo, "客户端对话框")
if choice = vbYes then
msgbox("你点击了'YES'按钮")
else
msgbox("你点击了'NO'按钮")
end if
</script>
</body>
</html> |
|