<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <center> <table border="1"> <tr> <td></td> <td>Id</td> <td>商品号</td> <td>商品名称</td> </tr> <?php foreach($arr as $v){?> <tr class="abc"> <td><input type="checkbox" value="<?php echo $v['goods_id']?>" name="all"/></td> <td><?php echo $v['goods_id']?></td> <td><?php echo $v['goods_sn']?></td> <td><?php echo $v['goods_name']?></td> </tr> <?php }?> </table> <input type="button" value="批删" id="more_del" οnclick="more_del(<?php echo $page?>)"/> </center> </body> </html> <script src="./jquery.js"></script> <script> function more_del(page){ var arr = new Array(); $("[name='all']:checked").each(function(i){ var goods_id = $(this).val(); arr[i] = goods_id; }); $.get('jdd.php',{arr:arr,page:page,act:'aaa'},function(obj){ console.log(obj); $("[name='all']:checked").each(function(i){ $(this).parent().parent().remove(); }); var str = ""; for(var i in obj){ str+= "<tr>"; str+= '<td><input type="checkbox" value="'+obj[i].goods_id+'" name="all"/></td>'; str+= "<td>"+obj[i].goods_id+"</td>"; str+= "<td>"+obj[i].goods_sn+"</td>"; str+= "<td>"+obj[i].goods_name+"</td>"; str+= "</tr>"; } $(".abc").last().after(str); // var obj = evel(); },'json'); } </script>
节点删除
最新推荐文章于 2022-05-14 19:55:53 发布