[php] Use confirm method in ajax to confirm deletion

little bottle
Release: 2023-04-06 06:26:01
forward
3204 people have browsed it


The main content of this article is about using the confirm method in ajax to achieve confirmed deletion. It has certain reference value and interested friends can learn about it.

<button name="del" type="button" class="btn btn-primary btn-xs" id="del">删除</button>
Copy after login


$("button[name=del]").click(
             statu = confirm("确定删除吗?"(!  operation = {..:'POST',:"{:url('Sections/del')}",:{idd:operation},:(msg == 1'删除成功'.'删除失败,请稍后重试',:'删除失败,请稍后重试'
Copy after login


    public function del()
   {
        $id=input('post.idd');
        $res = $this->section->del($id);
        echo json_encode($res);
   }
Copy after login
      del( = Section::destroy(['id' =>
Copy after login

If you want to know more PHP examples, please pay attention to the PHP video tutorial on the PHP Chinese website!

The above is the detailed content of [php] Use confirm method in ajax to confirm deletion. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!