Home » Backbone.js sync() function with Examples

Backbone.js sync() function with Examples

by Online Tutorials Library

Backbone.sync()

Backbone.sync is a function that is called every time when Backbone.js tries to read or save a model to the server. It is used to display the state of the model.

Syntax:

Parameter explanation:

method: It specifies the CRUD methods i.e. create, read, update and delete.

model: It specifies the model to be saved or collection to be read.

options: It displays success or error message depending on the method succeeded.

Let’s take an example.

See this example:

You may also like