gpt4 book ai didi

JavaScript:带有适用于 chrome、firefox 的自定义函数的 windows.external

转载 作者:行者123 更新时间:2023-11-28 07:23:12 24 4
gpt4 key购买 nike

我有一个 JavaScript 文件,它使用 windows.external 调用一些外部函数(不同文件中的函数)

 windows.external.setValue('Hi');

但以上仅适用于 IE。我希望 Chrome 和 Firefox 具有相同的功能。

最佳答案

谷歌搜索后我得到以下结论:

我们可以在父js或html文件中定义函数,并且调用方式如下:

 Chrome/Firefox --> window.parent.customFunction()
IE --> window.external.customFunction()

关于JavaScript:带有适用于 chrome、firefox 的自定义函数的 windows.external,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30051880/

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