gpt4 book ai didi

javascript - 我需要从外部 javascript 文件中调用 vbscript 函数::函数

转载 作者:行者123 更新时间:2023-11-30 13:39:46 25 4
gpt4 key购买 nike

这是我到目前为止得到的:

此函数不直接在 html 页面中,它在外部 js 文件“main.js”中。

function createVBScript(){
var script=document.createElement('script');
script.type='text/vbscript';
script.src='vb/fldt.vbs';
document.getElementsByTagName('head')[0].appendChild(script);
}

vbs 文件包含:

<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
Function VBGetSwfVer()
MsgBox "Hello there"
End Function
// -->

这就是我暂时想做的。 如何从 main.js 调用 VBGetSwfVer()

最佳答案

这是个坏主意。
VBScript 仅 IE 支持;您的页面将永远无法在 Firefox 上运行。

在 Internet Explorer 中,您应该能够像调用任何其他函数一样简单地调用该函数。
但是,您应该将函数移植到 Javascript。

关于javascript - 我需要从外部 javascript 文件中调用 vbscript 函数::函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2929231/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com