Suppose I have an HTML document with the following content:
<p onclick="hiho('@name')"> clicky </p>
<script>
function hiho(namevar){
var1 = @Names.find.where().eq("name", namevar).findUnique();
if( var1 != null){
alert("HIHO");
}
}
</script>
Is there a way to effectively utilize the JavaScript variable in this scenario?
The Play framework won't compile correctly due to the issue highlighted within:
var1 = @Names.find.where().eq("name", namevar).findUnique();
It seems unable to locate the value of namevar at that point.