Hi,
Is there a way to place php var with LF such as: $p="string1 \n string2"
into: var j="<? echo $p ?>";
I am getting an error in j assigment: Unterminated string constant
Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<?
$p="string1 \n string2"
?>
<script>
var j="<? echo $p ?>";
alert(j);
</script>
</body>
</html>
Is there a way to place php var with LF such as: $p="string1 \n string2"
into: var j="<? echo $p ?>";
I am getting an error in j assigment: Unterminated string constant
Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<?
$p="string1 \n string2"
?>
<script>
var j="<? echo $p ?>";
alert(j);
</script>
</body>
</html>
Comment