zoukankan      html  css  js  c++  java
  • 家庭账本开发day08

    对查询到额数据进行相关的操作,删除。对删除按钮绑定事件

    点击后发送ajax请求到servlet,删除相关的数据后,返回flag到前端

    若后台删除成功,则前台进行相应的.close();输出点击行的数据。若

    失败弹出提示。

    //向服务端发送删除指令
                            $.ajax({
                                url:'BillServlet?method=delete',
                                type:'post',
                                data:{'id':data.billid},//向服务端发送删除的id
                                success:function(flag){
                                    console.log(flag);
                                    console.log(typeof flag);
                                    if(flag=="true"){
                                        obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
                                        layer.close(index);
                                        console.log(index);
                                        layer.msg("删除成功",{icon:1});
                                    }
                                    else{
                                        layer.msg("删除失败",{icon:5});
                                    }
                                }
                            });
                            layer.close(index);

  • 相关阅读:
    I Hate It
    hdu 2112 HDU Today ( Dijkstra )
    hdu 1280 前m大的数
    hdu 4252 A Famous City
    hdu 2647 Reward
    hdu 2845 Beans
    hdu 3548 Enumerate the Triangles ( 优 化 )
    hdu 3552 I can do it! (贪心)
    HDU 3033 I love sneakers!(分组背包变形)
    hdu 1712 ACboy needs your help 分组背包
  • 原文地址:https://www.cnblogs.com/zhukaile/p/14449117.html
Copyright © 2011-2022 走看看