"unterminated string literal"
<p>I have the following PHP code:</p>

<pre><code>$string .= '&lt;script&gt;addJSBeforeEndBody(\'$(document).ready(function() { bkLib.onDomLoaded(function() { nicEditors.allTextAreas() }); });\');&lt;/script&gt;';
</code></pre>

<p>and the <code>addJSBeforeEndBody()</code> function:</p>

<pre><code>function addJSBeforeEndBody(code) {
     $('body').append('&lt;script&gt;'+code.toString()+"&lt;/script&gt;");
}
</code></pre>

<p>Why do I keep getting an error:</p>

<blockquote>
  <p>unterminated string literal</p>
  
  <p>$<code>('body').append('&lt;script&gt;'+code.toString()+"</code></p>
</blockquote>

<p>And an arrow points to <code>"</code> in Firebug.</p>
