这是控制台出现错误的代码。
/**
* Convert html into correct element
* @param html
*/
html2element:function (html) {
var attributes = {},
$template;
if (_.isString(html)) {
this.template = _.template(html);
$template = $(this.template(this.model.toJSON()).trim());
} else {
this.template = html;
$template = html;
}
_.each($template.get(0).attributes, function (attr) {
attributes[attr.name] = attr.value;
});
this.$el.attr(attributes).html($template.html());
this.setContent();
this.renderContent();
},
it causes the page editor not to load!
see the line where there is an error in the code.
如果我违反了任何规则或没有足够详细地解释问题,我提前道歉。
如果可能请告知。
最佳答案
请看我的回答here .
我通过将 html2element
函数更新为以下内容来修复此错误:
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()
},
在 /wp-content/plugins/js_composer/assets/js/backend/composer-view.js
希望这对你有用!
关于javascript - 更新到 WP 4.5 后,Wordpress 中的 Visual Composer 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36622793/