Escaping line break (endline) from PHP variable for Javascript usage
<p>heres my code :   </p>

<pre><code>&lt;td onclick="openFile('&lt;?php echo htmlentities ($row['name'])?&gt;','
                      &lt;?php echo htmlentities ($row['content'])?&gt;')"&gt;
    &lt;a href="#nf" data-toggle="tab"&gt;&lt;?php echo $row['name']?&gt;&lt;/a&gt;&lt;/td&gt;
</code></pre>

<p>as there is an endline char in $row['content']:</p>

<blockquote>
  <p>openFile('wow','wow                   wow</p>
  
  <p>wow ');</p>
</blockquote>

<p>and when browser cant find an ending qoutes in the same line it throws an </p>

<p>error(SyntaxError: unterminated string literal
[Break On This Error]). </p>

<p>Any solution for this ?</p>
