backbone.js Sync

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

sync is a function that Backbone uses to handle all sending or receiving of data to/from a remote server. The default implementation uses jQuery (or Zepto) to perform AJAX operations when data is synced. However, this method can be overriden to apply different syncing behavior, such as: - Using setTimeout to batch multiple updates into a single request - Sending model data as XML instead of JSON - Using WebSockets instead of Ajax

Syntax

  • sync(method, model, options)

Parameters

parameterdetails
methodcreate , read , update , delete
modelthe model to be saved (or collection to be read)
optionssuccess and error callbacks, and all other jQuery request options


Got any backbone.js Question?