Re: how to pass an array to Java script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry foe yhe inconvenience...

Script is given below..
 $name = $_GET['photo'];
 $id = $_GET['ga_id'];
 $objGA  = new Gallery_Album($db);
 $objError = $objGA->getAlbum($id);
 $y = unserialize($objError['ga_images']);
 echo "<br>";
 $count = count($y);
  function getArray($count)
 {
 for ($i = 0; $i < $count ; $i++)
 {
 $domain = stristr($y[$i]['photo'] , '-');
 $value[$i] =str_replace("-","",$domain);
 $numberslide[].= $value[$i];
  }
 return $numberslide;
 }

////////////////////////


 echo "<script type='text/javascript>";
 echo "var numberslide = new Array()";
  for ($i = 0; $i < $count ; $i++)
 {
 echo "numberslide[$i] = '$numberslide[$i]';\n";
 echo "alert("numberslide[$i]")";
 }
 echo "</script>";

i want to preload the images to the client side and then to display from the
client side..
 Johny

On 12/9/05, Curt Zirzow <czirzow@xxxxxxxxx> wrote:
>
> On Fri, Dec 09, 2005 at 08:30:51PM -0800, Johny John wrote:
> > Hi,
> >          How to pass an array (from php )  to java script and display it
> > using javascript?...
>
> What is your array?
>
> What do you expect your script to do?
>
> What context is this to be outputed to?
>
> Sorry, i had to pull a 'Jay Blanchard' on ya...
>
> Curt.
> --
> cat .signature: No such file or directory
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux