Answer the question
In order to leave comments, you need to log in
How to fix [Object object] when compiling Handlebars in Backbone?
Let's say we have the following trivial application: pastebin.com/f7A12eKE
When the page is rendered, the following text is displayed: [Object object]
But if in line 31 we change it to:
this.$el.html(this.template({ value: this.section.render().$el.html() }));
Answer the question
In order to leave comments, you need to log in
It all depends on what's going on in your template.
A template is just a function that takes arguments. You pass either a jQuery object in the value key in the first case (and, apparently, you do somewhere toString, which just returns [Object object]), or an html string in the second case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question