Currently, I am utilizing the Play framework and attempting to transmit a Json string from the server as a parameter to a Scala template.
@(aj: String)
@import play.api.libs.json.Json
<!DOCTYPE html>
<html lang="en">
<body>
<div id="container">
@aj
</div>
<script>
var <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6b7b4eb969ca5b9b8f8a2b99ca5b9b8">[email protected]</a>(aj);
var a = JSON.parse(ab);
</script>
</body>
</html>
The output I am currently getting is that the Json String is being displayed inside the container div. However, I am encountering difficulties when trying to extract the Json from 'aj' into a javascript variable. Any assistance on this matter would be greatly appreciated.