I am getting this error in WordPress when I am using a plugin called WpBakery Visual Composer.
I am using the latest version of WordPress (4.5), using the latest Go
Please see my answer here.
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
or in wp-content/plugins/js_composer/assets/js/dist/backend.min.js`
Hope this works for you!
Someone posted on the WordPress forums this solution which worked for me.
Replace the html2element
function in /wp-content/plugins/js_composer/assets/js/backend/composer-view.js
with the following.
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()
},
Edit: I had to make this replacement a second time under different circumstances, and it didn't start working until I disabled and then reenabled both the Visual Composer plugin and the Ultimate Visual Composer add-on.