how to access the $(this) inside ajax success callback function

Posted by askkirati on Stack Overflow See other posts from Stack Overflow or by askkirati
Published on 2010-04-15T08:38:28Z Indexed on 2010/04/15 8:43 UTC
Read the original article Hit count: 237

Filed under:
|

It seems that i cannot access $(this) inside jquery ajax success function. please see below code.

 $.ajax({
            type: 'post',
            url: '<?php echo site_url('user/accept_deny_friendship_request')?>',
            data: 'action='+$action+'&user_id='+$user_id,
            success: function(response){
               //cannot access $(this) here $(this).parent().remove();
            }
        });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX