代码之家  ›  专栏  ›  技术社区  ›  Ross

jQuery回调未被调用

  •  3
  • Ross  · 技术社区  · 16 年前

    .post jQuery的AJAX方法:

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

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

    1 回复  |  直到 16 年前
        1
  •  3
  •   Marc Gravell    16 年前

    $('.item input').click(function() {
        var tmp = this;
        $.post('complete.php', {item: this.id}, function() {
            $(tmp).parent().fadeOut('slow');
        });
    });