何が間違っているのか理解できません。成功とエラーのコールバックが発生せず、サーバーからJSON応答を返しています。私が台無しにしている場所についてのアイデアはありますか?
mysite.city.delete_photo = {
"Model": Backbone.Model.extend({
"id": "deletePhoto",
"initialize": function initialize(id) {
this.url = "/assets/ajax/delete_image.php?img_id=" + id;
}
}),
"View": Backbone.View.extend({
"initialize": function initialize(id) {
_.bindAll(this,
"render",
"success");
this.model = new mysite.city.delete_photo.Model(id);
this.render();
},
"render": function render() {
this.model.destroy({
"cache": false,
"success": this.success,
"error": this.error
});
},
"success": function success(model, data) {
console.log("test");
},
"error": function error() {
message('error', 'This image could not be deleted.');
}
})
};