I had a problem where I was defining javascript variables from php variables, and the php variables had multiple lines.
So, a function like this:
function SomeFunction() {
var variable = “<?php echo $variable; ?>”;
}
was creating this:
function SomeFunction() {
var variable = “The first row.
The second row.
The third row
“;
}
The fix was to replace all the ‘\n’ with ‘\\n’, so [...]