I\'m trying to make a small backbone.js app, but struggle with the order of things.
In my html file, I have two script blocks in the header:
Resets the model's state from the server. Useful if the model has never been populated with data, or if you'd like to ensure that you have the latest server state. A "change" event will be triggered if the server's state differs from the current attributes. Accepts success and error callbacks in the options hash, which are passed (model, response) as arguments.
In this case, you'll want to render the view in the success callback.
model.fetch({
error: function () {
},
success: function (model, response) { // model is ready now
// do view stuff here
}
});