相关疑难解决方法(0)

如何在ajax成功回调函数中访问$(this)

看来我无法在jquery ajax成功函数中访问$(this).请看下面的代码.

 $.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();
            }
        });
Run Code Online (Sandbox Code Playgroud)

ajax jquery

30
推荐指数
3
解决办法
2万
查看次数

标签 统计

ajax ×1

jquery ×1