简体   繁体   English

jQuery冲突导致错误?

[英]jQuery conflict causing errors?

I recently switched from Squarespace to Wordpress. 我最近从Squarespace切换到Wordpress。 I am currently using the Bridge theme, but this comes with Visual Composer. 我目前正在使用Bridge主题,但这是Visual Composer。 I don't really like VC, so I tried installing Beaver Builder instead. 我真的不喜欢VC,所以我尝试安装Beaver Builder。 However, I get some errors in the console when starting the Page Builder. 但是,在启动页面构建器时,我在控制台中出现了一些错误。 This impact the Page Builder as I cannot use text editor. 这会影响Page Builder,因为我无法使用文本编辑器。 I can't type text in the text editor & also the icons above the text area frame are not visible. 我无法在文本编辑器中键入文本,也无法看到文本区域框架上方的图标。

Below, you can see the errors: 在下面,您可以看到错误:

"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)"

As the error states there are some issues with my plugins.js & I deactivated this file. 由于错误说明我的插件有一些问题。我和我停用了这个文件。 Next, Beaver Builder works. 接下来,Beaver Builder工作。 But when I disable this file, a lot of JS effects on the website do no longer function. 但是当我禁用这个文件时,网站上的很多JS效果都不再起作用了。

Does anyone have experience with this kind of error? 有没有人有这种错误的经验? I think it is related to a jQuery version conflict, but I am not sure? 我认为这与jQuery版本冲突有关,但我不确定? If you need more information, ask & I'll provide. 如果您需要更多信息,请询问并提供。

Update after installing jQuery plugin: 安装jQuery插件后更新:

Below, installing the jQuery plugin was suggested. 下面,建议安装jQuery插件。 Error messages in the console have changed, but still having the issue with the text editor. 控制台中的错误消息已更改,但仍然存在文本编辑器的问题。

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 automatically calls the core jQuery, which may not be the most recent version . WordPress会自动调用核心jQuery,这可能不是最新版本 You could try running jQuery Updater and see if this pertains to the jQuery version. 您可以尝试运行jQuery Updater ,看看它是否属于jQuery版本。

Another thing to look for is if more than one jQuery script is being called on the page - an easy way to check is to simply export the page as static HTML and search for any duplicate/redundant calls of the script. 要查找的另一件事是在页面上调用多个jQuery脚本 - 一种简单的检查方法是将页面导出为静态HTML并搜索脚本的任何重复/冗余调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM