model.fetch

fetchmodel.fetch([options]) Merges the model's state with attributes fetched from the server by delegating to Backbone.sync. Returns a jqXHR. Useful if the model has never been populated with data, or if you'd like to ensure that you have the latest server state. Triggers a "change" event if the server's state differs from the current attributes. fetch accepts success and error callbacks in the options hash, which are both passed (model, response, options) as arguments. // Poll every 10 sec

model.save

savemodel.save([attributes], [options]) Save a model to your database (or alternative persistence layer), by delegating to Backbone.sync. Returns a jqXHR if validation is successful and false otherwise. The attributes hash (as in set) should contain the attributes you'd like to change â keys that aren't mentioned won't be altered â but, a complete representation of the resource will be sent to the server. As with set, you may pass individual keys and values instead of a hash. If the mod

Backbone.emulateJSON

emulateJSONBackbone.emulateJSON = true If you're working with a legacy web server that can't handle requests encoded as application/json, setting Backbone.emulateJSON = true; will cause the JSON to be serialized under a model parameter, and the request to be made with a application/x-www-form-urlencoded MIME type, as if from an HTML form.

model.values

values

collection.create

createcollection.create(attributes, [options]) Convenience to create a new instance of a model within a collection. Equivalent to instantiating a model with a hash of attributes, saving the model to the server, and adding the model to the set after being successfully created. Returns the new model. If client-side validation failed, the model will be unsaved, with validation errors. In order for this to work, you should set the model property of the collection. The create method can accept eit

model.get

getmodel.get(attribute) Get the current value of an attribute from the model. For example: note.get("title")

model.pick

pick

collection.first

first (head, take)

collection.max

max

model.toJSON

toJSONmodel.toJSON([options]) Return a shallow copy of the model's attributes for JSON stringification. This can be used for persistence, serialization, or for augmentation before being sent to the server. The name of this method is a bit confusing, as it doesn't actually return a JSON string â but I'm afraid that it's the way that the JavaScript API for JSON.stringify works. var artist = new Backbone.Model({ firstName: "Wassily", lastName: "Kandinsky" }); artist.set({birthday: "Dec