Java: Carriage returns populating a var in js code?
<p>I am not sure if this is possible, but I'm trying to find a front-end solution to this situation:</p>

<p>I am setting a JavaScript variable to a dynamic tag, populated by backend Java code:</p>

<pre><code>var myString = '@myDynamicContent@';
</code></pre>

<p>However, there are some situations, in which the content from the output contains a carriage return; which breaks the code:</p>

<pre><code>var mystring = '&lt;div&gt;
                Carriage Return happened above and below.
                &lt;/div&gt;';
</code></pre>

<p>Is there anyway I can resolve this problem on the front-end? Or is it too late in the script to do something about it, because the dynamic tag will run before any JavaScript runs (thus the script is broken by that point)?</p>
