ajax批删

<td><input type="checkbox"     name="bb"  value="{{$v->id}}"> {{$v->id}}</td>
<button id="pi">批删</button>

//批量刪除

$(document).on("click","#pi",function () {       nam=document.getElementsByName("bb");       str="";      for (i=0;i<nam.length;i++){       if (nam[i].checked==true){            str+=","+nam[i].value;

       }      }      id=str.substr(1);     $.ajax({         url:"shan",         type:"post",         dataType:"json",         data:{             id:id         },         success:function (data) { console.log(data);             if (data==1){                 location.href=""             }         }     })

})
function  shan(req $req){       $id= $req->post("id");       $id=explode(",",$id);

     foreach ($id as $k=>$v){         $res= DB::table("poker")->delete($v);     }     return  1;}

原文地址:https://www.cnblogs.com/azzy/p/11748799.html

时间: 2024-08-30 18:07:25

ajax批删的相关文章

ajax全选、全不选、反选、单删/批删

show.php <meta charset="utf-8"> <?php //链接数据库 $link = mysqli_connect('127.0.0.1','root','root','mone'); //设置字符集 mysqli_query($link,'set names utf8'); //接收当前页 $page = empty($_GET['page'])?1:$_GET['page']; //求出总条数 $sql = "select * fr

批删,全选

<th>全选<input type="checkbox" onclick="all_()" class="che_"></th> <td><input type="checkbox" name="check_" value="<?php echo $v['w_id'] ?>"></td> function

全选 批删

<div class="layui-form">            <table class="layui-table" id="tableuser">                <colgroup>                    <col width="80">                    <col width="100"&g

jquery实现分页+单删批删

//定义一个分页的方法 public function fenye(){ //查询满足条件的总条数 $count = M("regis")->count(); //设置每页显示的条数 $length = 3; //求出总页数 $zong_page = ceil($count/$length); //接收一下当前页 $page = empty($_GET['page'])? 1 : $_GET['page']; //求出偏移量 $limit = ($page-1)*$length;

tp5中ajax方式提交表单

用ajax提交表单,迅速,快捷,实现页面无刷新提交表单. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ajax批删</title> </head> <body> <center> <table> <tr> <td>姓名</t

Exchange 2016通过New-mailboxSearch批量删邮件

1)首先需要添加删邮件的权限 Assign eDiscovery permissions in Exchange 2016 https://technet.microsoft.com/en-us/library/dd298059(v=exchg.160).aspx2)然后执行命令进行批删查询 Create an In-Place eDiscovery search in Exchange 2016 https://technet.microsoft.com/en-us/library/dd353

关于MVC工厂模式的增删改查sql存储过程

这里MVC中用到了反射,工厂,泛型,接口 在搭建框架的时候,除了MVC的三层以外,还有泛型的接口层和工厂层 下面是dal层调用sql存储过程,增删改查,dal层继承了接口层,实现了接口层里面的方法 1 namespace DAL 2 { 3 public class DalHouse : IHouse 4 { 5 public int Add(HouseInfo m) 6 { 7 string sql = "pro_add"; 8 SqlParameter eid = new SqlP

MongoDB C# CRUD (3)

题记:媳妇要求发上来.这篇我要上首页. 1,NuGet引入MongoDB.接着是命名空间 using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Builders; using MongoDB.Driver.Linq; 2,全局声明 MongoDatabase mongo = new MongoClient(ConfigurationManager.AppSettings["PSConnStrMongoDB"]).G

jQuery 3.0 的变化

时隔 3 个月,jQuery 团队终于发布了 3.0 Alpha 版本.有两个版本 jQuery compat 3.0 和 jQuery 3.0. jQuery compat 3.0 对应之前的 1.x, 兼容更多的浏览器,对于IE支持到 8.0 版本 jQuery 3.0 对应之前的 2.x,关注更新的浏览器,对于IE支持到 9.0 版本 此外, 3.0还增加了对 Yandex 浏览器的支持,一款来自俄罗斯的浏览器. 1.简化了 show/hide 之前的 show/hide 是大兼容,比如