Results 1 to 4 of 4

Thread: I can only get this script to work on my index.html page

  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I can only get this script to work on my index.html page

    1) Script Title: Image w/ Description tooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...agetooltip.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?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    FF's error console reports this:

    Error: illegal character
    Source File: http://eshrunk.com/newsports.html
    Line: 360, Column: 93
    Source Code:
    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):

    Code:
    messages[9] = new Array('http://i3.photobucket.com/albums/y69/Quintox/f1.jpg','Formula1.com','#FFFFFF');
    There could also be other problems.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oddly enough, that worked. Wow, thanks

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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes, it breaks the array, making it an invalid object. Since the script depends upon the array object, it breaks the entire script.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •