SyntaxError: Unexpected token ILLEGAL caused by \u2028 and \u2029
<p>I am sending a sting as a parameter to a JavaScript function:</p>

<pre><code>theJSFunction('say hi dude');
</code></pre>

<p>Chrome gives me <code>SyntaxError: Unexpected token ILLEGAL</code> so after research, I've found that the following whitespaces generates the error <code>\u2028</code> and <code>\u2029</code>.</p>

<p>The problem is, the string posted to the function is printed via PHP and I need it to be printed via PHP (could use ajax, but I am required to let the PHP print it).</p>

<p>Is there any way to remove those to characters through PHP or JavaScript?</p>
