从 Javascript 调用 VBScript [英] Calling VBScript from Javascript
问题描述
我看过相关的帖子,但它只涵盖了对 onmouseover 事件使用内联 VBScript,同时为 onClick 调用 Javascript 函数.
I've seen the related post on this, but it only covers using inline VBScript for onmouseover events, while calling a Javascript Function for the onClick.
有没有办法从使用 Javascript onmouseover 和 onmouseout 事件的按钮为 onClick 事件调用 VBScript Sub?
Is there a way to call a VBScript Sub for the onClick event from a button that uses Javascript onmouseover and onmouseout events?
目前,当我尝试时,我收到一个错误,指出该对象不支持该属性或方法.
Currently when I try I get an error that the object does not support the property or method.
推荐答案
将您的代码放入 Head 标签
:</head>
在这些括号之间添加您的 VBScript
:
Add your VBScript
between these brackets:
<script type="text/vbscript">
</script>
Function myVBFunction()
' here comes your vbscript code
End Function
// From a hardcoded link, don't write a semicolon a the end:
<a href="#" onclick="VBscript:myVBFunction('parameter')">link</a>
您可以在此处阅读更多相关信息.
You can read more about it here.
这篇关于从 Javascript 调用 VBScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!