Javatpoint Logo
Javatpoint Logo

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:

Test it Now

Output:

Save the above code in sync.html file and open this file in a new browser.

BackboneJS sync Model



Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA