繁体   English   中英

为什么VBS根本无法在我的IE中工作?

[英]Why VBS wont work in my IE at all?

我正在尝试用vbs创建一个html。 但它根本不起作用。 我确定我的IE10中启用了运行脚本。 IE9。 我也在chrome和firefox中尝试过,但都不起作用。

我只是想知道我的代码或IE是否存在问题。 我知道IE 11将不再支持vbs,但我们仍然支持IE 10。

这只是一个简单的测试页,但无法正常工作.....

<html>
<head>
<title>Validation in Button Event</title>

<script language="VBScript">
<!--

Sub Button1_OnClick
    Dim TheForm
    Set TheForm = Document.forms("ValidForm")
    If IsNumeric(TheForm.Text1.Value) Then
        If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
            MsgBox "Please enter a number between 1 and 10."
        Else
            MsgBox "Thank you."
            TheForm.Submit
        End If
    Else
        MsgBox "Please enter a numeric value."
    End If

End Sub
-->
</script>
</head>

<body>
<h3>Validation in Button Event</h3>
<hr>

<form id="ValidForm">

Enter a value between 1 and 10: 
<input name="Text1" type="text" size="2">
<input name="Button1" type="button" value="Click Here">

</form>

</body>
</html>

在这个例子中,VBScript被注释掉了

VBScript在Firefox中仍然可以正常运行(始终具有)(我当前正在使用版本32.0.3)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM