i have this jQuery code:
$("#text_a").html('<textarea name = "text">".$text_user."</textarea>');
And if I put in textarea text with new line i get this error:
unterminated string literal
I get an error with this text:
First line...
Second line ...
Assuming that this is actually a PHP question, I normally use json_encode() to generate JavaScript strings. E.g.:
Back into JavaScript, you probably want to avoid HTML injection and XSS attacks:
Addendum
A little test case that illustrates the need of proper escaping: