I have this:
$('#wallCommentResponse' + wallID).append('<div class="userWallComment"><a id="showCommentLink' + wallID +'" class="showCommentLink" ref="'+ wallID +'" data-id="'+ howMany +'" style="cursor: pointer;">Hide comments</a></div>').show();
INSIDE the click function.
I have this to show a box, with the link "hide comments" at the bottom of all the comments. It shows it how i want to, but when i click nothing happens. And i have binded .showCommentLink to
$('.hideWhenShowAll' + wallID).show();
I have another link, just like this, but is not showing by append() but normal HTML, that you also can click on "Hide comments" and it works very well, and its binded to the same function.
So something must be wrong when you append the link, inside the same function that the link triggers on click?
What is wrong? thank you