PDA

View Full Version : I can only get this script to work on my index.html page



Quintox
07-20-2007, 05:00 AM
1) Script Title: Image w/ Description tooltip

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

3) Describe problem:

I used this script on my index.html page, works great. Now, I created another page (sports.html), used same source code from index.html but changed the parameters, etc. Only thing is, it doesn't work. I went through to see what might be different but everything is exactly the same. I can't figure out why this isn't working. I even changed the messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF"); to messages[555] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
just to make sure that wasn't the problem.

Here is where it's working: http://eshrunk.com/new.html
Here where it isn't : http://eshrunk.com/newsports.html

Anyone see what's wrong?

jscheuer1
07-20-2007, 05:37 AM
FF's error console reports this:


Error: illegal character
Source File: http://eshrunk.com/newsports.html
Line: 360, Column: 93
Source Code:

messages[9] = new Array('http://i3.photobucket.com/albums/y69/Quintox/f1.jpg','Formula1.com,'#FFFFFF');

Which basically means that you left out a delimiter (red in the below corrected version):


messages[9] = new Array('http://i3.photobucket.com/albums/y69/Quintox/f1.jpg','Formula1.com','#FFFFFF');

There could also be other problems.

Quintox
07-20-2007, 06:06 AM
Oddly enough, that worked. Wow, thanks

I thought that would only cause an error for just that one image, not the whole script :)

jscheuer1
07-20-2007, 02:12 PM
Yes, it breaks the array, making it an invalid object. Since the script depends upon the array object, it breaks the entire script.