私はbackbone.jsを使用して簡単なRSSアプリを開発しようとしています。私はこのbackbone.jsチュートリアルを使用しています。テンプレートを定義すると、2行目(テンプレート)で次のエラーが発生します。チュートリアルでtagName: "li"が定義されている理由を誰かに教えてもらえますか?
キャッチされないTypeError:未定義のbackbone.jsのメソッド'replace'を呼び出すことができません
Javscript
window.SourceListView = Backbone.View.extend({
tagName:"li",
template: _.template($('#tmpl_sourcelist').html()),
initialize:function () {
this.model.bind("change", this.render, this);
this.model.bind("destroy", this.close, this);
},
render:function (eventName) {
$(this.$el).html(this.template(this.model.toJSON()));
return this;
},
close:function () {
$(this.el).unbind();
$(this.el).remove();
}
});
HTML
<script type="text/template" id="tmpl_sourcelist">
<div id="source">
<a href='#Source/<%=id%>'<%=name%></a>
</div>
</script>
ありがとう