For those who have not yet tried it, I would highly recommend TIm Branyen's Backbone.LayoutManager [1]. It solves items 1 and 2 very well. [1] https://github.com/tbranyen/backbone.layoutmanager
Avoiding Common Backbone.js Pitfalls
11–15 of 15 posts
Re: Avoiding Common Backbone.js Pitfalls
#12Great article highlighting some common areas for attention -- especially when first moving from vanilla jQuery to something like Backbone ... but important for any basic Model/View layer separation. For what it's worth, all 5 of these points are addressed by the Backbone docs, and there are some further nuances worth mentioning: 1. listenTo() is great when you're connecting from an object (frequently a View) that wil…
Re: Avoiding Common Backbone.js Pitfalls
#13It's better to have your main app page completely static so it can be cached. That said, don't use ajax either - load the initial data via its own script tag.
Re: Avoiding Common Backbone.js Pitfalls
#14Respectfully disagree with point 3 - "Doing unnecessary XHR requests on page load". It's better to have your main app page completely static so it can be cached. That said, don't use ajax either - load the initial data via its own script tag.
Someone in the comments there mentioned a nice alternative to embeddding the data in a tag to avoid the problem jashkenas raised ( in the JSON). Namely, setting it in a data- attribute.
Re: Avoiding Common Backbone.js Pitfalls
#15Respectfully disagree with point 3 - "Doing unnecessary XHR requests on page load". It's better to have your main app page completely static so it can be cached. That said, don't use ajax either - load the initial data via its own script tag.