Update:
It appears to be $displayWalla global JS variable ( <a href='javascript:showComments($displayWall[id]);'>it wonโt work otherwise ). Then this should work too:
$('#linkId').click(function() {
showComments($displayWall[id]);
});
Now I understand that the following assumption is far, but nonetheless:
Assuming that it $displayWallis a server-side variable, that is, the page is pre-processed.
You can, for example, set the attribute of a reflink to the value of a variable:
<a id="linkId" ref="$displayWall[id]">test</a>
:
$('#linkId').click(function() {
showCmments($(this).attr('ref'));
});
, :
$('#linkId').click(function() {
var value = '$displayWall[id]';
});