jQuery :::删除真的删除了吗? [英] jQuery ::: Does remove really remove?
问题描述
我正在尝试使用jQuery删除表格行,尽管它从屏幕上消失了,因此似乎可以正常工作,但是在Firebug中,我仍然可以看到它的代码.该行中有表单元素,因此,我想了解该行是否真正被删除,因为我不想提交这些值.那么,删除真的删除了吗?下面是我正在使用的代码...也许我做错了吗?
I'm trying to remove a table row using jQuery, and while it disappears from the screen, and therefore, appears to work, in Firebug, I can still see the code for it. There are form elements in this row, and so, I want to understand whether the row is truly being deleted or not, because I wouldn't want those values submitted. So, does remove really remove? Below is the code I'm using... Maybe I'm doing it wrong?
if($('.delete')) {
$(".delete").live('click', function(event) {
$(this).closest('tr').remove();
});
}
推荐答案
页面的源代码不会使用Javascript函数进行更新.如果您在Firebug中检查DOM,则应该能够看到所反映的更改.
The source of a page doesn't update with Javascript functions. If you inspect the DOM in Firebug you should be able to see the changes reflected.
这篇关于jQuery :::删除真的删除了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!