This is my implementation of birgire's last suggestion (to parse the onclick):
jQuery(document).on( 'click', 'a.comment-reply-link', function( event ) {
// THIS PART GETS THE COMMENT ID
var hayStack = jQuery(this).attr('onclick');
var strawA = '"div-comment-';
var strawB = '"';
var tipNeedle = hayStack.lastIndexOf(strawA)+strawA.length;
var hayTruss = hayStack.substring(tipNeedle);
var endNeedle = hayTruss.indexOf(strawB);
var needle = hayTruss.substring(0, endNeedle);
alert(needle);
// optional: THIS PART LOOKS UP THE PARENT ID (php side not shown)
var datatopost = {
action: 'my_ajax_hook',
nonce: ajaxobject.nonce,
selected_comment_id: needle,
};
jQuery.ajax({
type: 'post',
dataType: 'json',
url: ajaxobject.ajaxurl,
data: datatopost,
error: function() { // Ajax request has failed
jQuery('#comment').val('An error has occurred');
},
success: function (response) { // Ajax request has succeeded
if (response.success) {
// JSON successfully received
alert(response.data.selected_comment_parent);
}
}
});
});