首页 > 解决方案 > 你好未定义

问题描述

<html>
<head>
    <script type="text/vbscript" >
        Function Hello()
        Msgbox "Hello World"
        End Function
    </script>
</head>
<body>
    <input type="button" value="click" onclick="Hello()" />
</body>
</html>

单击按钮后,我得到 Hello is undefined

标签: htmlvbscript

解决方案


当前没有浏览器支持 VBScript。

如果你想在客户端使用它,那么你需要:

  • 安装旧版本的 Internet Explorer
  • 使用 Internet Explorer 11 并将其配置为在仿真设置中使用 IE 10 文档模式。

一般来说,如果你想在浏览器中进行客户端编程,那么你需要编写 JavaScript(或者你可以转换成 JavaScript 的东西,比如 TypeScript)。


推荐阅读