You probably need to wrap the value in $l in quotes, like this:
$l='"something_nothing_anything"';
문제
I am getting ReferenceError:something_anything_nothing is not defined error... Please help.
<script>
function show(str)
{
var r=str;
alert(r);
}
</script>
<?php
$l='something_nothing_anything';
echo "<select onChange='show($l)'>";
echo "<option></option>";
echo "</select>";
?>
해결책
You probably need to wrap the value in $l in quotes, like this:
$l='"something_nothing_anything"';
다른 팁
$l='Somethin_nothin_anythin';
$buffer="<select onchange='show(\'".$l."\')'>";
$buffer.= "<option></option>";
$buffer.="</select>";
echo $buffer;
Try this