Results 1 to 9 of 9

Thread: Image Thumbnail Viewer problem

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

    Default Image Thumbnail Viewer problem

    1) Script Title:
    Image Thumbnail Viewer

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

    3) Describe problem:

    Hi! I'm newish to using scripts and I'm having trouble with this page:

    http://www.aaronwinslow.com/hmrc/pho...ns/index.xhtml

    When the thumbnail is clicked, the image is opened in the browser window without the desired Image Thumbnail Viewer stylishness. I think I'm overlooking something very simple.

    Thanks for any thought you put into this!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It seems your entire page isn't returning the proper text/html header when requested from the server. For example, have you tried viewing your page in IE? The browser prompts to download the page instead of load it...

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    adwin (04-06-2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I've been viewing it in ff. I don't have IE installed on this machine at this point.

    I just switched the text/html header to (which is the standard for the people I'm working for:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!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" xml:lang="en" lang="en">

    and the script is (not) working in the same way. Do you have any advice?

    Thank you! Thank you!

  5. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The page is still be prompted to be downloaded in IE instead of the usual loading it, so there's still a problem even with the change you made. FYI in Firefox, the error message reported the Java Console when the page loads is:

    Error: uncaught exception: [Exception... "Object cannot be created in this context" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "http://www.aaronwinslow.com/hmrc/photocollections/thumbnailviewer.js Line: 20"]
    This isn't a typical JS error, and my guess is it's related to the error in your page's header response as well.

  6. The Following User Says Thank You to ddadmin For This Useful Post:

    adwin (04-06-2008)

  7. #5
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much for looking at this. I realize that this isn't really the purpose of this forum... do you see anything in the header that seems incorrect? This is it:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!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" xml:lang="en" lang="en">
    <head>
    <title>Houston Public Library - Houston Metropolitan Research Center</title>
    <link rel="stylesheet" href="../main_hpl.css" type="text/css" />
    <link rel="stylesheet" href="thumbnailviewer.css" type="text/css" />
    <script src="thumbnailviewer.js" type="text/javascript">

    /***********************************************
    * Image Thumbnail Viewer Script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for legal use.
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    </script>

    </head>

  8. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try removing this part from your HTML:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>

  9. The Following User Says Thank You to ddadmin For This Useful Post:

    adwin (04-06-2008)

  10. #7
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks! I removed:

    <?xml version="1.0" encoding="iso-8859-1"?>

    I'm still getting that error that you mentioned. Any ideas?

  11. #8
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    and the seemingly related problem of the script not working.

  12. #9
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    From poking around in various forums, I learned that Firefox doesn't support document.write in application/xhtml+xml pages. So I changed my page from xhtml to html. And now the script works very nicely.

    Thanks for your help!

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
  •