|
Posted by Shelly on 10/30/07 00:11
"David Williams" <dw149@acmex.gatech.edu> wrote in message
news:fg5rk9$be5$1@news-int.gatech.edu...
>
> Can anyone see why the javascript var abc here is not getting assigned
> the php var ("Hello")? in my code? I have tried a lot of different ways
> but the javascript variable will not take.
>
>
> Thanks,
> David
>
>
> <script>
> var abc
> <?php
> $sizeof_image_array=5;
> for($i=0;$i<$sizeof_image_array;$i++)
> {
>
> $temp_image_name="Hello";
> echo 'abc=<?php echo $temp_image_name;?>;';
> echo 'alert(abc);';
>
> }
> ?>
> </script>
>
Why do you have <?php followed by <?php ? Don't you mean
echo 'abc = "' . $temp_image_name . '";' ;
Also, why is this in a loop?
Shelly
[Back to original message]
|