gpt4 book ai didi

Javascript 插件无法在 Safari 中运行

转载 作者:行者123 更新时间:2023-11-27 22:56:43 25 4
gpt4 key购买 nike

我在 WordPress 中安装了一个插件。插件名称是响亮的背景音乐。该插件适用于除 Safari 之外的所有浏览器:声音不播放且按钮暂停不起作用。

错误是:

typeerror undefined is not a function
(evaluating _this.audio_player_element.pause()')

这是下载文件js的链接

https://www.wetransfer.com/downloads/c2169c2ad8096778decaed1df7304cd520160530203306/397086fa9a12eba87669072851c7e0da20160530203306/33f9d1

最佳答案

1) 因为有 .attr(),我假设你正在使用 jQuery 您可能正在使用多个 jquery 脚本(相互竞争)。

2)因为您正在确定范围,并且您实际上可能正在调用超出范围的对象。

3) 如果您使用的脚本不适用于 Safari,那么就会发生这种情况。

if( _this.audio_player_element.paused )
{
//you will never reach this because audio_player_element is undefined which gives false due to your scope or being taken by another jquery $ script
}
else
{
//you will always end up here, and you are trying to pause() the undefined.
}

关于Javascript 插件无法在 Safari 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37532998/

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