首页 > 开发 > PHP > 正文

在ajax中用confirm方法实现确定删除

2024-05-04 22:02:10
字体:
来源:转载
供稿:网友

本篇文章的主要内容是关于在ajax中用confirm方法实现确定删除,具有一定参考价值,感兴趣的朋友可以学习一下。

  1. <button name="del" type="button" class="btn btn-primary btn-xs" id="del">删除</button> 
  2.  
  3. $("button[name=del]").click( 
  4. statu = confirm("确定删除吗?"(!  operation = {..:'POST',:"{:url('Sections/del')}",:{idd:operation},:(msg == 1'删除成功'.'删除失败,请稍后重试',:'删除失败,请稍后重试' 
  5.  
  6. public function del() 
  7.  
  8.  
  9.      $id=input('post.idd'); 
  10.  
  11.      $res = $this->section->del($id); 
  12.  
  13.      echo json_encode($res); 
  14.  
  15.  
  16. del( = Section::destroy(['id' => 

上一篇:php-fpm是什么?

下一篇:memcache是什么?

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表