javascript - Backbone adding content to current view -
i'm not familiar backbone have project support has tiny usages of backbone. there spot in backbone script of page:
app.views.products = backbone.view.extend({ tagname: "table", classname : "table table-bordered table-hover data-table", });
which initializes view-template , parse table , renders view. want add before table, have added following piece above code not work, , adds content beginning of table:
initialize : function(){ this.$el.prepend("i have added content,"); }
.prepend()
method inserts specified content first child of matched element(s).
in case have use .before
method instead:
initialize : function(){ this.$el.before("i have added content,"); }
Comments
Post a Comment