Reply to Re: [PHP] how to pass an array to Java script

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация