Problem with mixing Javascript the PHP
<p>I am trying to assign values in javascript assigned from PHP and the use document.write() to output them. The problem is when I do this, a complete blank screen shows up but no errors are ever thrown. But if I take the PHP out and put in a value such as 'ABC' it works. And example of my code can be this:</p>

<pre><code>var comment_text="&lt;?php echo $value['comment_text'];?&gt;";
var bodyelement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
newdiv.style.textAlign = 'center';
            newdiv.style.zIndex = 10001;
            newdiv.style.left = (&lt;?php echo $comment_x;?&gt;+getPos('browserwindow',"Left")-23) + 'px';
            newdiv.style.top = (&lt;?php echo $comment_y;?&gt;+getPos('browserwindow',"Top")-90) + 'px';
            newdiv.style.position = 'absolute';
newdiv.innerHTML = comment_text;
        bodyelement.appendChild(newdiv);
</code></pre>

<p>I do have an PHP error log and no errors are beign thrown either. The values are retrieved from the database, the probem comes with outputting them.
<strong><em>*</em></strong><em>UPDATE</em><strong><em>*</em></strong>
Ok, I had this problem before.</p>

<p>Basically a newline is created like this:</p>

<pre><code>var comment_text="cool Beans
</code></pre>

<p>";</p>

<p>I have tried to remove the newline with string replace but doesn't seem to work. Why would a new line like this cause this error?</p>
