putting a php array into javascript
Posted: Sun Jul 09, 2006 4:26 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i am having trouble getting this array, "$text", distributed to this javascript - can anyone offer a hand...?
thanks
gCode: Select all
global $onMouseOver, $onMouseOut, $picsArray, $textArray, $picUrl;
$idx = 0;
while ($idx <= 6) {
$pic = $picsArray[$idx];
$purl = $picUrl[$pic];
$text = $textArray[$idx];
?>
<script language="JavaScript" type="text/javascript">
Text[8]=["<?php print "$text"; ?>","next line..."]
applyCssFilter()
</script>
<?
//////
$line = "<td width=\"100\" background=\"stars/".$pic."\"><a href=\"".$phpLink."\" target=\"_blank\"><img src=\"stars/gold.gif\" width=\"100\" height=\"100\" border=\"0\" onMouseOver=\"stm(Text[8],Style[5])\" onMouseOut=\"htm()\" /></a></td>";
}
print $line."\n";
$idx++;feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]