I am passing a gstring as a parameter to a javascript function as shown:
<div class="btn btn-small" id="helpful" onClick="helpful(${value})">Helpful</div>
Here, value comes from controller which is dynamic. I have javascript function as:
function helpful(answer){
$.post("${createLink(controller: "reviews", action: "dataFromReviews")}",
{
helpful:true,
answer:answer
}
);
}
But I am not getting any response. No error while inspecting. Can't we pass gstring in javascript? Please help.