If I generate some Javascript in my Scala code like this:
<script type="text/javascript">
foo("{bar}");
</script>
and the Javascript contains a double quote character (like in the example), it will appear as " when the XML is converted into a string, and Firefox will reject this Javascript as having a syntax error.
How can I avoid this Javascript error, without removing "s that are actually needed?
I’m using Play framework 1.2.4 with the Scala module 0.9.1, which requires Scala 2.8.1.
would something like this work for you?