jQuery ajax 呼び出しの後に $(this) が機能しないのはなぜでしょうか。
私のコードはこのようなものです。
$('.agree').live("click", function(){ // use live for binding of ajax results
var id=($(this).attr('comment_id'));
$.ajax({
type: "POST",
url: "includes/ajax.php?request=agree&id="+id,
success: function(response) {
$(this).append('hihi');
}
});
return false;
});
この場合、ajax 呼び出し後に $(this) が機能しないのはなぜですか? ajaxの前に使用しても機能しますが、その後は効果がありません。