You need to have valid javascript code, which is not happening when you
have several lines in text. You want to get to
output +="Line1\nLine2\nLine3\n"; // += is the same as a=a+
so
<? function jsencode($str)
{
return implode('\n',explode("\n",$str)); //Could use str_replace -
probably better.
}?>