Home  >  Article  >  Web Front-end  >  jquery code to delete a row in the table through a tag_jquery

jquery code to delete a row in the table through a tag_jquery

WBOY
WBOYOriginal
2016-05-16 17:11:061644browse
复制代码 代码如下:

复制代码 代码如下:

function deleteOwner(id,obj){
var o=$(obj);
if(confirm("确定删除?")){
$.post(
"deleteOwner!deleteOwner",
{id: id},
function(){
alert("删除成功!!!");
o.parents("tr").remove();
}
);
}
}

1.刚开始因为this放错位置了,死活不成功!得注意。

2.直接用obj报错,要将其打包成对象$(obj)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn