zoukankan      html  css  js  c++  java
  • jQuery ajax使用$(this).parent()无效解决方法

    div=$(this).parent(); //先获取父级元素



    div.remove(); //再删除



    $(".delStu").click(function () {
                           td = $(this).parent().parent();
                           if (confirm("您确认删除么")) {
                               $.ajax({
                                   url: "/Demo/Student/DelStudent",
                                   type: "POST",
                                   data: { ID: $(this).attr('data-id') },
                                   success: function (data) {
                                       if(data.msg=="删除成功");
                                       {
                                           console.log(data);
                                           td.remove();
                                       }
                                   },
                                   error: function () {
                                       console.log("error");
                                   }
                               })


                           } else {
                               
                           }
                       });

  • 相关阅读:
    JavaScript那些事儿-不被知晓的预解释
    史上最难PHPer笔试题,40分就能月薪过万!附答案
    composer命令卡慢,使用国内源
    Github 上的 iOS 开源项目
    CSS3新属性:在网站中使用访客电脑里没有安装的字体
    Python批量重命名文件
    Python登录TP-Link路由器换ip脚本
    source 批量导入SQL文件
    代码
    excel字符拼接
  • 原文地址:https://www.cnblogs.com/MartinLee/p/7622697.html
Copyright © 2011-2022 走看看