Posted On: Feb 22, 2018
Backbone.sync is a function that is Backbone js call every time it attempts to read or save a model to the server.By default, it uses jQuery.ajax to make a RESTful JSON request and returns a jqXHR
Example Code
Backbone.sync = function(method, model) { alert(method + ": " + JSON.stringify(model)); model.set('id', 1); }; var author= new Backbone.Model({ author: "Sharad", website: "https://www.onlineinterviewquestions.com" }); author.save(); author.save({author: "Teddy"});
Never Miss an Articles from us.
Backbone.js is a client-side (Model, View, Controller) MVC-based JavaScript framework.It purely is written in Javascrip..
Backbone’s Js only hard dependency is Underscore.js ( >= 1.8.3). For RESTful persistence and DOM manipulation with..
The Backbone.js router is used to change the URL fragment or hashes of an application to create bookmarkable and shareab..