未捕获的TypeError:$ template.get不是函数 [英] Uncaught TypeError: $template.get is not a function
问题描述
当我使用名为WpBakery Visual Composer的插件时,我在WordPress中收到此错误。
I am getting this error in WordPress when I am using a plugin called WpBakery Visual Composer.
我使用的是最新版本的WordPress(4.5),使用最新的谷歌Chrome版本,所有插件都已更新。我似乎无法使用Visual Composer添加任何元素或模板。
I am using the latest version of WordPress (4.5), using the latest Google Chrome version and all plugins are updated. I cannot seem to be able to add any elements or templates using Visual Composer.
有人可以帮助我或告诉我可能会发生什么以及如何解决此错误。
Can someone help me or tell me what could be going on and how I can fix this error.
我得到的错误:
推荐答案
请参阅我的答案这里。
我通过更新 html2element
修复了这个错误函数:
I fixed this bug by updating the html2element
function to:
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()
},
in / wp-content / plugins / js_composer / assets / js /backend/composer-view.js
或wp-content / plugins / js_composer / assets / js / dist / backend.min。 js`
or in wp-content/plugins/js_composer/assets/js/dist/backend.min.js`
希望这适合你!
这篇关于未捕获的TypeError:$ template.get不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!