Backbone.js的DELETE请求没有发射 [英] Backbone.js DELETE request not firing
问题描述
我试图让Backbone.js的DELETE请求开火,但没有看到我的控制台进行的任何请求。
I'm trying to get the backbone.js DELETE request to fire, but don't see any requests being made in my console.
我有收集模型,像这样:
I have collection model like so:
var Model = Backbone.Model.extend(
{
urlRoot: '/test',
defaults:{}
});
var TableList = Backbone.Collection.extend(
{
url: '/test',
model: Model
});
在我看来,我运行以下命令:
In my view I'm running this:
this.model.destroy();
似乎一切都运行良好,我可以看到输出调用破坏remove函数来了,所以我知道它到达那里,再加上它也运行成功,我有一个unrender方法。无法看到任何请求被以断绝做,但?
Everything seems to be running fine, I can see output coming from the remove function that calls the destroy so I know it's getting there plus it also successfully runs an unrender method that I have. Can't see any requests being made to the sever though?
推荐答案
我发现这个问题我的问题,没有想到一个解决方案呢。我不知道这是与骨干网或不是一个错误,但我使用 ajaxSetup
和 AJAX prefilter
。我试图评论它和它的工作。我把范围缩小到ajaxSetup方法和具体使用数据
参数preSET一些值。
I found the issue to my problem, thought not a solution yet. I'm not sure this is a bug with backbone or not, but I'm using ajaxSetup
and ajaxPrefilter
. I tried commenting it out and it worked. I narrowed it down to the ajaxSetup method and the specifically the use of the data
parameter to preset some values.
这篇关于Backbone.js的DELETE请求没有发射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!