Created
February 15, 2012 12:49
-
-
Save imehr/1835449 to your computer and use it in GitHub Desktop.
BackboneJS View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*el is created using the attributes from the view’s tagName, className, or id properties. If none of these is specified, el is an empty div: | |
*/ | |
var UserView = Backbone.View.extend({ | |
tagName: "span", | |
className: "users" | |
}); | |
// Binding a view onto an existing element in the page. | |
// Make sure the view is set up after the page has loaded. | |
var UserView = Backbone.View.extend({ | |
el: $("..users") | |
}); | |
// Passing el as an option when instantiating a view | |
new UserView({id: "followers"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment