|
Posted by Michael Hulse on 12/10/05 06:43
On Dec 9, 2005, at 8:30 PM, Johny John wrote:
> Hi,
> How to pass an array (from php ) to java script and display
> it
> using javascript?...
>
> Jasus.
Well,
FWIK, Here is how you pass a variable:
<script type="text/javascript" language="javascript">
<?php echo "var picUrl = '$picUrl';\n"; ?>
document.write(picUrl);
</script>
So, if you know how to instantiate an array in JS, just do a PHP loop
where you pull contents out of the PHP array an put into the JS
array... then you can do whatever you want with the array later in your
JS script... AFAIK.
Hth,
Cheers,
Micky
Navigation:
[Reply to this message]
|