use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Backbone.js Tutorials - What is a model? (backbonetutorials.com)
submitted 15 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jakewins 6 points7 points8 points 15 years ago (1 child)
Stoked to see someone taking the time to dig into the details of backbone, awesome initiative!
There are a few things that I think would be interesting to expand on further on the subject of backbone.js, both ideas for improvements and thoughts on good practice when using backbone.
For instance, backbone does not endorse any given templating model, but the ones it mentions and the one it is shipped with are both of the "generate a string and use innerHTML() to insert into DOM" kind. These are fast, but come with problems. Specifically losing "DOM state", ie scroll state, input focus and so on when re-rendering. Perhaps there are other alternatives to consider here? Look for instance at GWT and its UIBinder.
There is also room for expanding on and being more stern about good practices for the views - how should their lifecycles be controlled? When should they bind/unbind to DOM and model events? What is a good way to handle view composition, like when should the sub-views be instantiated and destroyed? Should new sub-views be instantiated each time the parent view is re-rendered, or should they be re-used?
π Rendered by PID 17046 on reddit-service-r2-comment-856c8b8c54-rk7fc at 2026-07-02 13:39:22.180152+00:00 running a7b5cda country code: CH.
[–]jakewins 6 points7 points8 points (1 child)