所以没什么特别的好处(这真的是困扰我).
我非常肯定有一些东西是我失踪的.
我非常肯定有一些东西是我失踪的.
所以这里有一些相对的代码:
_me.attributes.answers.push(oAnswer); _me.save(null,{ success : function(){ console.log('saved the answer'); q = new q.Questions() ; q.fetch({ success : function(data){ console.log('reloading the template with this data'); console.log(data) this.render({model:data,el:this.$el}) } }) },error : function(model,response,x){ console.log('error') console.log(response) console.log(x) } });
现在我可以在我的控制台中看到已经发出请求(PUT)并且服务器响应是200(OK).
但我仍然得到错误记录,当我试图记录响应我得到了这个
readyState 4 responseText "OK" status 200 statusText "OK"
仍然主干只是为_me.save激发错误处理程序,为什么呢?
解决方法
根据解析函数,您的服务器响应无效.保存时,请尝试将“parse:false”传递给模型选项
model.save(attrs,{ success: function() { ... },parse : false });
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。