mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Merge branch 'master' into demos
This commit is contained in:
@@ -603,10 +603,11 @@
|
||||
// * Persist models via WebSockets instead of Ajax.
|
||||
//
|
||||
Backbone.sync = function(method, model, success, error) {
|
||||
var data = method === 'read' ? {} : {model : JSON.stringify(model)};
|
||||
$.ajax({
|
||||
url : getUrl(model),
|
||||
type : methodMap[method],
|
||||
data : {model : JSON.stringify(model)},
|
||||
data : data,
|
||||
dataType : 'json',
|
||||
success : success,
|
||||
error : error
|
||||
|
||||
Reference in New Issue
Block a user