【发布时间】:2016-02-15 20:52:12
【问题描述】:
我正在处理一个主干项目,其中我的 js 文件具有映射到模型的保存功能。
this.model.save({
success:function(){
},
attrs : attrs,
.
.
.
.
})
在我得到的同步功能的主干模型中
sync:function(method, model, options){
if(method == 'update'){
options.url = 'my url here';
options.data = JSON.stringify(_.omit(this.attributes,['username','firstname']))
}
}
如果我检查网络响应,输出(在 chrome 中)是
{'password':'','lastname':''}:
希望您能看到最后一个分号(在大括号之后)与发送的对象一起出现。
我用邮递员测试了没有 : 的响应,它工作正常。所以我得出结论,在我的 PUT 请求被拒绝的数据中添加了分号。
我该如何克服?
【问题讨论】:
标签: backbone.js