Backbone model.destroy() invoking error callback function even when it works fine?

后端 未结 5 1326
不知归路
不知归路 2021-02-05 01:01

I have a Backbone.js model that I\'m trying to destroy when the user clicks a link in the model\'s view. The view is something like this (pseudocode because it\'s implemented in

5条回答
  •  Happy的楠姐
    2021-02-05 01:45

    Using the Slim Framework on an LAMP server you can add a Response Status to DELETE routes (or custom routes that don't return anything)

    $app->response()->status(204);//204 No Content

    this also sets the Content-Type back to text/html to allow for the empty body

提交回复
热议问题