Menu
im wondering if it its possible to get data from the database and store it in the javascript variable…i tried doing this :
var x = “<?php echo($data[‘id’]); ?>”;
document.write(“<select> <option> x </option> </select>”);
or even something like this
<script langugae=”JavaScript” type=”text/javascript”>
item = new Array(<?php echo $ctr; ?>);
for(var i=0;i<<?=$ctr?>;i++)
{
item[i] = “<?php
$x = 0;
$_SESSION[‘x’] = $x++;
echo $item[$_SESSION[‘x’]]; ?>”;
}
</script>
but no values would come out can anyone tellme wats wrong? thanks