Array[0] has no properties
am 10.04.2008 03:25:20 von neridaj
Hello,
I have a multidim array that is generated with php and I don't
understand why/how to fix these errors:
Error: atrarr[0] has no properties
Error: atrarr[imgname] has no properties
I put an alert in the change_slide() function and it says the var
imgname is undefined however, upon viewing the php output the var
imgname is defined.
Here is the php output:
Here is the php code:
$pictarr = get_imgarr();
$atrarr = get_imgdim();
$imgfolder = get_imgdir();
$trimgnum = trim($_GET['in'], ".jpg");
?>
Re: Array[0] has no properties
am 10.04.2008 05:22:03 von Jerry Stuckle
neridaj@gmail.com wrote:
> Hello,
>
> I have a multidim array that is generated with php and I don't
> understand why/how to fix these errors:
>
> Error: atrarr[0] has no properties
> Error: atrarr[imgname] has no properties
>
> I put an alert in the change_slide() function and it says the var
> imgname is undefined however, upon viewing the php output the var
> imgname is defined.
>
You have a javascript problem - not a PHP one. Yes, the code was
generated by PHP, but that's only via echo statements, and it's incorrect.
In your function change_slide, neither imgname nor atrarr are defined.
They are only visible outside of the function.
Look at the javascript in your source code, then determine what is
needed in PHP to fix it. comp.lang.javascript can help you there.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================