VOOZH about

URL: https://www.geeksforgeeks.org/javascript/backbone-js-sync-backbone-sync-function/

⇱ Backbone.js Sync Backbone.sync() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Backbone.js Sync Backbone.sync() Function

Last Updated : 23 Jul, 2025

Backbone.js is a compact library used to organize JavaScript code. Another name for it is an MVC/MV* framework. If MVC isn't familiar to you, it merely denotes a method of user interface design. JavaScript functions make it much simpler to create a program's user interface. Models, views, events, routers, and collections are among the building blocks offered by BackboneJS to help developers create client-side web applications.

Backbone.js Sync is the method that is called Backbone.js to read or save a model to the server. It is utilized to show the model's current status(which CRUD method is being performed).

Syntax:

sync(method, model, options)

Parameters:

  • method: It represents the CRUD operations like create, read, update and delete.
  • model: It represents the model which will be saved or the collection which will be read.
  • options: It provides the feedback message on whether the method succeeded or not.

Example 1: The code below demonstrates how we can read or create a model and see the method using Sync.

Output:

👁 Image
 

Example 2: The code below demonstrates how we can read a collection and see the method using Sync.

Comment