How can I display an entry string, with included special characters (like single and double quotes) , inside a script tag without translating these special characters into html entities but escaping their quotes?
By default: Carlo's "string"
will output Carlo's "string"
which in javascript if the variable is shown on screen will show all the characters of the html entities.
I have tried:
<script>
var string = '{{ creatif.creatifsName|raw }}'
</script>
Which removes the html entities but obviously the script will not work because the quotes are not escaped.