How to handle dynamically returning values given by php with multiple lines?
<p>I'm trying to realize an indexhandler. Now I can click on a field in HTML and a second window appears. Then, by clicking one of several buttons on the second page, a value gets returned in the field of the first window. This works like this:</p>

<pre><code>self.opener.document.getElementById('idOfFieldOnWindow1').value = 'myValue';
</code></pre>

<p>The value here "<code>myValue</code>" gets read out of a database by php. This value can also be a text with more than one lines (it contains at least one or more linebreaks). If I write these values in the code, it gives me a JavaScript Exception:</p>

<pre><code>ERROR: unterminated string literal
setValue("Text on which a linebreak follows
</code></pre>

<p>How can I solve this that I can return the value so it gets shown in the first field including linebreaks?</p>
