Tutorial by Examples

Assuming this HTML in the page: <body> <div id="myPage"> </div> </body> A view can be bound to it with: var MyPageView = Backbone.View.extend( { "el": "#myPage", "template": _.template( "<p>This is m...
initialize is called by Backbone right after a View is constructed. Optional parameters The initialize function receives any arguments passed to the view's constructor. Commonly, the options hash that is used to pass the view's default options: ['model', 'collection', 'el', 'id', 'attributes', 'c...

Page 1 of 1