Answer the question
In order to leave comments, you need to log in
What is the best way to delete an object?
Let's say we have a link
(id - variable)
What is the best way to implement the transfer of id to the server, taking into account the fact that we need to delete the object with this id ?
1) Use jQuery and ajax for the "DELETE" method.
2) Leave the "GET" method and intercept the id on the server as a named route ?
If there is a third option, I'd love to hear it. <a href="<id>">Delete</a>
Answer the question
In order to leave comments, you need to log in
AJAX or not, jQuery or not, see for yourself, ideally AJAX is ubiquitous (SPA), in practice, as it turns out, HTTP methods do not need any DELETE, do everything on GET or POST, many libraries that implement HTTP for the client have convenient means for sending GET and POST, but no DELETE, etc., and there are also CMS for servers, etc., where no one will write $_REQUEST['id']
, but either $_GET or $_POST.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question