If I have a html document with this:
<p onclick="hiho('@name')"> clicky </p>
<script>
function hiho(namevar){
var1 = @Names.find.where().eq("name", namevar).findUnique();
if( var1 != null){
alert("HIHO");
}
}
</script>
How do I use the JavaScript variable?
Play won't compile properly because inside
var1 = @Names.find.where().eq("name", namevar).findUnique();
it cannot find the value of namevar.