collection.reject

reject

collection.shift

shiftcollection.shift([options]) Remove and return the first model from a collection. Takes the same options as remove.

model.escape

escapemodel.escape(attribute) Similar to get, but returns the HTML-escaped version of a model's attribute. If you're interpolating data from the model into HTML, using escape to retrieve attributes will prevent XSS attacks. var hacker = new Backbone.Model({ name: "<script>alert('xss')</script>" }); alert(hacker.escape('name'));

collection.partition

partition

model.clear

clearmodel.clear([options]) Removes all attributes from the model, including the id attribute. Fires a "change" event unless silent is passed as an option.

collection.sync

synccollection.sync(method, collection, [options]) Uses Backbone.sync to persist the state of a collection to the server. Can be overridden for custom behavior.

collection.shuffle

shuffle

collection.add

addcollection.add(models, [options]) Add a model (or an array of models) to the collection, firing an "add" event for each model, and an "update" event afterwards. If a model property is defined, you may also pass raw attributes objects, and have them be vivified as instances of the model. Returns the added (or preexisting, if duplicate) models. Pass {at: index} to splice the model into the collection at the specified index. If you're adding models to the collection that are already in the co

Router.extend

extendBackbone.Router.extend(properties, [classProperties]) Get started by creating a custom router class. Define actions that are triggered when certain URL fragments are matched, and provide a routes hash that pairs routes to actions. Note that you'll want to avoid using a leading slash in your route definitions: var Workspace = Backbone.Router.extend({ routes: { "help": "help", // #help "search/:query": "search", // #search/kiwis "search/:query/p

View

constructor / initializenew View([options]) There are several special options that, if passed, will be attached directly to the view: model, collection, el, id, className, tagName, attributes and events. If the view defines an initialize function, it will be called when the view is first created. If you'd like to create a view that references an element already in the DOM, pass in the element as an option: new View({el: existingElement}) var doc = documents.first(); new DocumentRow({ mod