相关疑难解决方法(0)

未捕获的TypeError:$ template.get不是函数

当我使用名为WpBakery Visual Composer的插件时,我在WordPress中收到此错误.

我正在使用最新版本的WordPress(4.5),使用最新的谷歌Chrome版本,所有插件都会更新.我似乎无法使用Visual Composer添加任何元素或模板.

有人可以帮助我或告诉我可能会发生什么以及如何解决此错误.

我得到的错误:

在此输入图像描述

javascript wordpress jquery

39
推荐指数
3
解决办法
5万
查看次数

Wordpress更新后的插件错误

我的托管服务提供商自动更新到4.5,导致Visual Composer插件出错.

我阅读了这些帖子: Wordpress 4.5更新后插件抛出TypeError

Visual Composer不加载并给出TypeError:_. trylate(...).trim不是函数

未捕获的TypeError:$ template.get不是函数

并将html2element函数替换为提供的函数.但是,由于很多人对这些帖子发表了评论,我收到了一个新错误:

composer-view.js?ver=4.6.1:139 Uncaught TypeError: Cannot read property 'attributes' of undefined
Run Code Online (Sandbox Code Playgroud)

这是我的功能:

html2element: function(html) {
            var $template, attributes = {},
                template = html;
            $template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
                attributes[attr.name] = attr.value
            }), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent()
        },
Run Code Online (Sandbox Code Playgroud)

错误似乎来自这一行:

$template.get(0).attributes
Run Code Online (Sandbox Code Playgroud)

有没有人想出如何解决它?

谢谢你的帮助

javascript wordpress jquery

3
推荐指数
1
解决办法
7568
查看次数

标签 统计

javascript ×2

jquery ×2

wordpress ×2