Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Last active December 10, 2015 13:18
Show Gist options
  • Save alexmcpherson/4439627 to your computer and use it in GitHub Desktop.
Save alexmcpherson/4439627 to your computer and use it in GitHub Desktop.
A typical implementation of a Backbone View's render method
var MyView = Backbone.View.extend({
initialize: function() {},
render: function() {
// Put content into the el
this.$el.append( /* some HTML */ );
// Put the el onto the page
$('#content').append(this.el);
}
});
new MyView().render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment