I have a question about backbone.js web application architecture. Say you are creating a Webapp movie collection. You would use a movie model and a collection for your movie collection.
The view for the collection is basically a li download.
So that web pages can be indexed by Google, you would be allowed to work without javascript and get server-side rendering. Thus, going to mydomain.com/12 on the server side will create html li elements for this collection.
If you needed to use backbone.js to modify the collection, you would need to load the data into the trunk. What is the best way to do this? Two ways I can come up with are ...
1) use jquery to iterate over the li elements that read data into the trunk - the problem is that the html probably only contains the names of the films, and not the information about the movie / movie director, which may be required in the base model, I believe that data can be included in html and hidden using css.
2) throw everything in the list and reload it from the server using ajax - which seems to me a waste, since all the data could be sent when the first page was loaded.
Are these methods good practice? If not, how to do it?
source share