gpt4 book ai didi

javascript - jQuery 冲突导致错误?

转载 作者:行者123 更新时间:2023-11-28 04:38:01 26 4
gpt4 key购买 nike

我最近从 Squarespace 切换到 Wordpress。我目前使用的是 Bridge 主题,但它附带了 Visual Composer。我不太喜欢 VC,所以我尝试安装 Beaver Builder。但是,启动页面生成器时,我在控制台中收到一些错误。这会影响页面生成器,因为我无法使用文本编辑器。我无法在文本编辑器中输入文本,并且文本区域框架上方的图标也不可见。

下面,您可以看到错误:

"Uncaught Error: no such method 'instance' for menu widget instance" op rij 2 van {bestand}.

Error: no such method 'instance' for menu widget instance
at Function.error (http://www.petasos.be/wp-includes/js/jquery/jquery.js?ver=1.12.4:2:1814)
at HTMLUListElement.<anonymous> (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8376)
at Function.each (http://www.petasos.be/wp-includes/js/jquery/jquery.js?ver=1.12.4:2:2881)
at a.fn.init.each (http://www.petasos.be/wp-includes/js/jquery/jquery.js?ver=1.12.4:2:846)
at a.fn.init.$.fn.(anonymous function) [as menu] (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8111)
at $.(anonymous function).(anonymous function)._create (http://www.petasos.be/wp-includes/js/jquery/ui/autocomplete.min.js?ver=1.11.4:11:2191)
at $.(anonymous function).(anonymous function)._create (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:6664)
at $.(anonymous function).(anonymous function)._createWidget (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:9651)
at new $.(anonymous function).(anonymous function) (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:5990)
at HTMLInputElement.<anonymous> (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8796)"

由于错误表明我的plugins.js存在一些问题并且我停用了该文件。接下来,Beaver Builder 开始工作。但是当我禁用这个文件时,网站上的很多JS效果就不再起作用了。

有人遇到过这种错误吗?我认为这与 jQuery 版本冲突有关,但我不确定?如果您需要更多信息,请询问,我会提供。

安装 jQuery 插件后更新:

下面建议安装 jQuery 插件。控制台中的错误消息已更改,但文本编辑器仍然存在问题。

Error: no such method 'instance' for menu widget instance
at Function.error (http://www.petasos.be/wp-content/plugins/jquery-updater/js/jquery-3.2.1.min.js?ver=3.2.1:2:1979)
at HTMLUListElement.<anonymous> (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8376)
at Function.each (http://www.petasos.be/wp-content/plugins/jquery-updater/js/jquery-3.2.1.min.js?ver=3.2.1:2:2715)
at a.fn.init.each (http://www.petasos.be/wp-content/plugins/jquery-updater/js/jquery-3.2.1.min.js?ver=3.2.1:2:1003)
at a.fn.init.$.fn.(anonymous function) [as menu] (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8111)
at $.(anonymous function).(anonymous function)._create (http://www.petasos.be/wp-includes/js/jquery/ui/autocomplete.min.js?ver=1.11.4:11:2191)
at $.(anonymous function).(anonymous function)._create (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:6664)
at $.(anonymous function).(anonymous function)._createWidget (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:9651)
at new $.(anonymous function).(anonymous function) (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:5990)
at HTMLInputElement.<anonymous> (http://www.petasos.be/wp-content/themes/bridge/js/plugins.js?ver=4.7.5:38:8796)

最佳答案

WordPress 自动调用核心 jQuery,may not be the most recent version 。您可以尝试运行 jQuery Updater并查看这是否与 jQuery 版本有关。

另一件事是要检查页面上是否调用了多个 jQuery 脚本 - 一种简单的检查方法是将页面导出为静态 HTML 并搜索脚本的任何重复/冗余调用。

关于javascript - jQuery 冲突导致错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44017583/

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