reference self in ajax callback

Solutions on MaxInterview for reference self in ajax callback by the best coders in the world

showing results for - "reference self in ajax callback"
Matteo
27 Jun 2016
1$.ajax({
2    context: this,
3    type: 'post',
4    url: '<?php echo site_url('user/accept_deny_friendship_request')?>',
5    data: 'action='+$action+'&user_id='+$user_id,
6    success: function(response){
7       //can access this now!
8    }
9});