创建backbone.sync同步请求,需要为每种请求类型创建单独的处理器
Backbone.sync = function(method,model,options) {
switch(method) {
case 'create':
// 处理create请求
break;
case 'read':
// 处理read请求
case 'update':
// 处理update请求
case 'delete':
// 处理delete请求
}
};