PDA

View Full Version : Image loader bug


E |A| E
09-05-2002, 07:09 PM
N'espère rien de l'homme s'il travaille pour sa propre vie et non pour son éternité

I have a problem with an lmage loader, the javascript alert locates the problem at the :mad: string of the code.

imgNames = new Array(
"/usr/local/apache/example/example.jpg",
"/usr/local/apache/example/example.jpg",
"/usr/local/apache/example/example.jpg",
) <----- :mad:

loadImgs = new Array()

for(i=0; i < imgNames.length; i++) {
loadImgs[i] = new Image;
loadImgs[i].src = imgNames[i];
}

As a result an alert generated calling for ')' when its there !!
Help would be greatly appreciated,

Regards. :D

beetle
09-05-2002, 08:32 PM
don't get angry at the parenthesis, get mad at that comma! ;)

imgNames = new Array(
"/usr/local/apache/example/example.jpg",
"/usr/local/apache/example/example.jpg",
"/usr/local/apache/example/example.jpg", <----- :mad:
)

Hehe, just remove that comma and you should be good.

E |A| E
09-06-2002, 12:05 AM
Thanks for your reply, I think I just made myself a reputation here, but what can you do, its a 'hands' on approach :o :thumbsup:
But its quite an issue that browsers are so intolerant toward .js
Regards.