String concatenation not working

me again:)

I got this page:

I got this PHP script which generates a javascript array of filenames.
Everything works fine when I add DIRNAME to the array strings in PHP,
but if I want to concatenate the strings in this for loop, it gets weird.

I’ve tried alert() both arrays when they are the same, and there is no difference there, however when the array of files (fadeimages) is supposed to get loaded into the slideshow it doesn’t get displayed.

When I look it from the Google Chrome Inspect element, the image src is the url and /i. That’s the begging of the path name, but why only the first letter?

Sorry for the wrong title, I quess the string concatenation really is working.


Did you actually write fadeshow? Only this code would be responsible for your problem:

for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()

I didn’t write teh slideshow script.

Why would it be different,
IF PHP generates the array

echo 'fadeimagesPHP['.$curimage.']=["'.$dirname.$file.'"];'."\

It would look like this:


And when javascript itself generated the array, I mean, removed the $dirname, from PHP, so javascript would add var path itself before the image name.

They look identical, I proved it with alerting both, when they were the same.
However one is working (PHP generated), and the other isn’t.

I think the problem could be with the slideshow script,
however it doesn’t make sense, unless there is some string specific thing going on.

The script appears to be expecting a two dimensional array, but that may not be what your script is producing, even if it alerts the same.