www.webdeveloper.com
Results 1 to 6 of 6

Thread: [RESOLVED] Random Images work but not in IE 8 and Opera 9.64

  1. #1
    Join Date
    May 2009
    Posts
    3

    resolved [RESOLVED] Random Images work but not in IE 8 and Opera 9.64

    Hello all,

    I've been banging my head against this all day and just can't seem to solve the problem.

    After using and altering a js random image generator code from the web, I've got it doing exactly what I wanted...but only on the mac.

    The page is supposed to display 5 random images next to each other.
    Looks great in firefox and safari.
    Opera shows 3 of 5 images.
    IE 8 on the PC only displays the navigation (with working roll-overs!)

    The site is listed here:
    http://huntdesign.com/HuntDesignWebs...ent/index.html

    The js is referred from here:
    http://huntdesign.com/HuntDesignWebs...ontent/hunt.js

    Your help would be invaluable since I really don't want to go back to the boss and say we *have* to use a single static image. :-)

    Thanks!

  2. #2
    Join Date
    Jun 2007
    Posts
    667
    Code:
    type="application/javascript"
    This designation isn't yet universally supported and therefore will be unusable for some time. Use:
    Code:
    type="text/javascript"
    This may be not be the only problem.

  3. #3
    Join Date
    May 2009
    Posts
    3

    Unhappy Changed Type, now worse in Opera, No Change IE 8

    Thank you SterlingIsFine for the correction.
    Sadly it only made the display in Opera worse by now also showing the contents of the <noscript> tags.

    Any other thoughts people might have?
    It seems so odd that it doesn't show anything in the Windows IE browser.
    It does work fine in the Windows Safari browser.

    Should I try to preLoad the images?

    So the scoreboard is as follows:
    PC: IE 8 = no
    PC: Safari = yes
    Mac: Safari = yes
    Mac: Firefox = yes
    Mac: Camino = yes
    Mac: Opera = partially (which really means no since I can't use it)

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Design for unobtrusive JavaScript and stop using document.write

    Load the document with default images.
    Preload the images.
    Change images onload.

  5. #5
    Join Date
    Jun 2007
    Posts
    667
    Quote Originally Posted by littleSparky View Post
    Thank you SterlingIsFine for the correction.
    Sadly it only made the display in Opera worse by now also showing the contents of the <noscript> tags.

    Any other thoughts people might have?
    First validate your markup. It's showing an error near the script block: http://validator.w3.org

  6. #6
    Join Date
    May 2009
    Posts
    3

    Thumbs up Random Images problem resolved

    Thank you all for your considerations and advice. I will learn to use other methods besides document.write.

    The error in the code was not closing the <img> tag in that obtrusive document.write script.

    Code:
    document.write('<img src="images/random/' + gallery[whichGallery][idx] + '" class="special" alt="" />');
    I've also been working hard to be clean on the validation reports.

    Thank you all, again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles