3

我正在使用.postjQuery 的 AJAX 方法:

// completion toggling
$('.item input').click(function() {
    $.post('complete.php', {item: this.id}, function() {
        $(this).parent().fadeOut('slow');
    });
});

我在这里做错了什么?AJAX 在记录更新时工作,但回调事件永远不会发生。Firebug 中也没有错误。

4

1 回答 1

3

我想知道在这一点上它是否不是一个不同的“这个”。尝试使用捕获:

$('.item input').click(function() {
    var tmp = this;
    $.post('complete.php', {item: this.id}, function() {
        $(tmp).parent().fadeOut('slow');
    });
});
于 2009-03-28T21:19:34.597 回答