
If would prefer something like that:

But of coures only if the variable is in a double quote string, because in a single quote string the text is echoed like it is.
Capricorn
Moderator: kfury77
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script> //<![CDATA[
alert("Hello");
// ]]>></script>
</head>
<body>
</body>
</html>
Code: Select all
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
/*]]>*/
</script>