Gra*_*ick 3 javascript wordpress jquery
我的托管服务提供商自动更新到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)
有没有人想出如何解决它?
谢谢你的帮助
FLX*_*FLX 17
有4.5相同的问题更新并尝试了我发现的一切,但它仍然无法正常工作.
最后,我用最近的一个(4.11.2,google js_composer.zip)替换了我的主题视觉作曲家插件(v4.7的东西).
我只是替换了整个目录内容,它运行正常.
| 归档时间: |
|
| 查看次数: |
7568 次 |
| 最近记录: |