Results 1 to 8 of 8

Thread: Image Thumbnail Viewer II

  1. #1
    Join Date
    Aug 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image Thumbnail Viewer II

    Script: Image Thumbnail Viewer II
    URL: http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    I am trying to use the Image Thumbnail Viewer II script on part of my website, located at http://plaza.ufl.edu/melanier/work/workmenu.html. The effect works in Internet Explorer, but in Firefox (my default browser), the image loads an entirely new page, instead of inside the div layer. This script works on the Dynamic Drive website and I remember seeing it working on other websites when I visit them via Firefox, but for some reason, I can't get it to work on mine, either locally or online.

    Can anyone look through my code and tell me what's wrong? I've already checked the location of the .js file; it seems to be correct.

    Thank you so much :]

  2. #2
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    Change this:
    Code:
    <script type="text/javascript" src="thumbnailviewer2.js" defer="defer">
    To this:
    Code:
    <script type="text/javascript" src="/thumbnailviewer2.js" defer="defer">
    Or this::
    Code:
    <script type="text/javascript" src="http://plaza.ufl.edu/melanier/work/thumbnailviewer2.js" defer="defer">

  3. #3
    Join Date
    Aug 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the suggestion. I tried it out but it still didn't work

  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

    This is very strange. The script looks fine. In fact, if I make a local copy of the page and set it up to use the script on your server, it works fine in FF. I believe that it may be your DOCTYPE, or perhaps something about the host settings. In any case, when the script gets served on the live page, it is filled with gibberish. This is something to do with the character encoding, but shouldn't be a problem for FF unless the server is doing something to the character encoding.

    Try replacing:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    with:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    Also, try replacing:

    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    with:

    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    If one or the other or both of those don't fix it, it is probably some setting on the server.
    - John
    ________________________

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

  5. #5
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    I think it's the server because I was able to set up a test page and I am running FF and IE and I was able to use her exact code except for the modification I had mentioned above and I was able to get it to work.

  6. #6
    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

    Quote Originally Posted by Dirt_Diver View Post
    I think it's the server because I was able to set up a test page and I am running FF and IE and I was able to use her exact code except for the modification I had mentioned above and I was able to get it to work.
    That could well be. I did the same, as I noted. Unfortunately, due to the local versions working in FF, we cannot test solutions on our end. However, the suggestions I outlined may fix it regardless, so should at least be tried.

    I'm a bit puzzled by the user saying that it wouldn't work for them locally in FF though.
    - John
    ________________________

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

  7. #7
    Join Date
    Aug 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for trying, jscheuer1. Your additional code changes didn't seem to help either. I think I'm going to try to upload the files to my host with another transfer type; right now it's set on binary. However, that doesn't seem to explain why it won't work locally. This is all so strange, because my website is the only site that this script doesn't work on.

  8. #8
    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

    Binary is generally the way to go. Make sure you've only saved the script file in a text only editor with it's encoding set to UTF-8 or other that will not save non-standard characters most text only editors (like NotePad) are set to something like this by default.

    I'm still thinking it may be something to do with your host. Try contacting them and asking if they have .js files set to be served as anything other than text/javascript or whatever the default is (possibly application/x-javascript).

    You could also try, when saving in a text only editor, change the filename to:

    thumbnailviewer2.txt

    and reference it that way in on your page:

    Code:
    <script type="text/javascript" src="thumbnailviewer2.txt" defer="defer">
    
    /***********************************************
    * Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    </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
  •