客户端/服务器交互 - 如何创建删除项目的能力?
我有一个网站,其中包含您可以在仪表板内创建、编辑和删除的“事物”(特定于每个用户)。查看仪表板中的某个项目时,您可以选择删除或编辑它。我想要一个允许删除的按钮,后跟一个确认框(“您确定要删除吗”)。
设置此功能的最佳方法是什么?我是否创建一个包含隐藏值的表单并且确认窗口将提交该表单?我是否要创建一个带有 GET 请求链接的按钮,以便在服务器端将其删除? (http://domain.com/delete?id=5
)。这更多是关于客户端和服务器应该如何以这种方式交互的问题?任何帮助将不胜感激。
I have a website with "things" that you can create, edit, and delete inside the dashboard (specific to each user). When viewing a certain item in the dashboard, you can choose to delete it or edit it. I want to have a button that allows for delete, followed by a confirmation box ("are you sure you want to delete").
What is the most best way to set this up? Do I create a form with hidden values and the confirmation window will submit the form? Do I create a button with a link for a GET request that deletes it on the server side? (http://domain.com/delete?id=5
). This is more a question about how the client and server should interact in this manner? Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将删除作为链接,然后调用删除这个东西的php脚本
Make delete as link and then call php script that delete this thing