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

Last updated

Was this helpful?