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 {
}
});
最新文章
- Js中的this指向问题
- 问题解决——WSAAsyncSelect模型 不触发 FD_CLOSE
- HDU 5418 Victor and World (Floyd + 状态压缩DP)
- C# winfrom 模拟ftp文件管理
- python自学笔记(九)python练习题
- JListDemo
- UiAutomator源码分析之注入事件
- 关于解决“No matching provisioning profiles found”问题-ios
- 【WCF】错误处理(三):错误协定
- IIS 部署.netcore 500.19错误
- Android 简单记事本
- 工程师常犯的web后台界面用户体验错误
- readlink: command not found 解决方案
- error: Microsoft Visual C++ 14.0 is required. Get it with ";Microsoft Visual C++ Build Tools";: http://landinghub.visualstudio.com/visual-cpp-build-tools
- csrfguard3.1 部署笔记
- 2.Redis五种数据结构
- 【转】Python 可视化神器-Plotly Express
- 探寻main函数的“标准”写法,以及获取main函数的参数、返回值
- Let it crash philosophy part II
- 脱离matlab运行可执行程序的步骤
热门文章
- JS中的toString()和valueOf()方法
- innobackupex基于binlog日志的恢复 -- 使用mysqlbinlog恢复
- hdu-1875 畅通工程再续---MST
- mac 下删除非空文件夹
- 2017.12.17 servlet 生命周期
- PAT (Advanced Level) Practise - 1094. The Largest Generation (25)
- 二十二、MySQL 正则表达式
- Bank Simulation Program银行管理系统C++ :)
- python爬虫的基本思路
- Python协程详解(二)