Backbone.js Tutorial - 9 - (Views) Using the Render Function (ok)

C:\Users\Administrator\Desktop\gulp\app.js
var theView = Backbone.View.extend({
initialize: function() {
this.render();
},
render: function() {
var template = _.template($("#ourTemplate").html(),{});
this.$el.html(template);
}
});
jQuery(document).ready(function($) {
var page = new theView({el: $("#div1")});
});C:\Users\Administrator\Desktop\gulp\index.html
PreviousBackbone.js Tutorial - 8 - (Views) Creating New HTML Elements (ok)NextBackbone.js Tutorial - 10 - (Views) Events (ok)
Last updated
Was this helpful?