jquery how to get the index of a click event when after doing an ajax call
<p>In the following code how would I use <code>$(this).parents('#friendRequest').remove();</code> in my ajax success callback function, and use <code>$(this)</code> to get selector of the click event in the first line?</p>

<pre><code>jQuery(".notyAcceptFriendRequest").on('click', function() {
    notyId = jQuery(this).attr("notyIdOne"); // pull in the id of the current selected notification
    userProfilesUserId = $('#requestAlert').attr('userProfilesUserId'); // pull in the id of the current selected user profile id
    if (notyId == userProfilesUserId) { // if notification id is the same as the user profiles id, do the following
        $("#requestAlert").replaceWith('&lt;span class="font1"&gt;You two are now friends&lt;/span&gt;'); // the user profile friend requester will be replaced with the text
        $(this).parents('#friendRequest').remove(); // find the '#friendRequest' id from the parent elements and fade it out
    } else if (notyId != userProfilesUserId) {
        /* the below will execute when the user
         * clicks the 'Add' button and he/she is
         * not on the targeted users page
         */
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "&lt;?=base_url()?&gt;index.php/reguserDash/acceptFriendNoty",
            data: {notyId: notyId},
            json: {friendshipCaneled: true},
            success: function(data) {
                if(data.acceptNotyFriendSuccess == true) {
                    $(this).parents('#friendRequest').remove();
                }
            }
        })
    }
});
</code></pre>
