IE 6.0+ refuses to pre-cache images?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Penelope Baker

    IE 6.0+ refuses to pre-cache images?

    Greetings:

    I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time the
    user rolls over a link, it rereads it from the server, even though it is
    well into the cache by that time. It works fine in Netscape, Mozilla,
    Firebird, Firefox, etc. Suggestions? (Other than the obvious one regarding
    IE :P)

    Thanks!

    Peace,
    Pen

    Javascript for the rollover included below.


    <head>
    <SCRIPT LANGUAGE = "javascript ">
    <!--

    if (document.image s) { // Active Images
    img1on = new Image();
    img1on.src = "images/right_buttoncap _rollover.gif";

    img1off = new Image();
    img1off.src = "images/right_buttoncap .gif";

    img2on = new Image();
    img2on.src = "images/right_buttoncap _rollover.gif";

    img2off = new Image();
    img2off.src = "images/right_buttoncap .gif";

    img3on = new Image();
    img3on.src = "images/right_buttoncap _rollover.gif";

    img3off = new Image();
    img3off.src = "images/right_buttoncap .gif";

    img4on = new Image();
    img4on.src = "images/right_buttoncap _rollover.gif";

    img4off = new Image();
    img4off.src = "images/right_buttoncap .gif";

    img5on = new Image();
    img5on.src = "images/right_buttoncap _rollover.gif";

    img5off = new Image();
    img5off.src = "images/right_buttoncap .gif";
    }

    // Function to 'activate' images.

    function imgOn(imgName) {
    if (document.image s) {
    document[imgName].src = eval(imgName + "on.src");
    }
    }

    // Function to 'deactivate' images.

    function imgOff(imgName) {
    if (document.image s) {
    document[imgName].src = eval(imgName + "off.src");
    }
    }

    window.onerror= null;
    // -->
    </SCRIPT>

    </head>

    <body>
    <a href="#top" onMouseOver="im gOn('img1')" onMouseOut="img Off('img1')"
    class="subnav_l ink">Latest News</a>


  • Eric Bohlman

    #2
    Re: IE 6.0+ refuses to pre-cache images?

    "Penelope Baker" <penelopebaker@ chartermi.net> wrote in
    news:1031rl2nr5 34176@corp.supe rnews.com:
    [color=blue]
    > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every
    > time the user rolls over a link, it rereads it from the server, even
    > though it is well into the cache by that time. It works fine in
    > Netscape, Mozilla, Firebird, Firefox, etc. Suggestions? (Other than
    > the obvious one regarding IE :P)[/color]

    Have you tried emptying your cache first? IE6 does some rather weird
    things (like not letting you view source) when its cache fills up.

    Comment

    • Penelope Baker

      #3
      Re: IE 6.0+ refuses to pre-cache images?

      Yeah, this happens on everyone's computer.

      Peace,
      Pen

      "Eric Bohlman" <ebohlman@earth link.net> wrote in message
      news:Xns94916CB 9A1AF3ebohlmano msdevcom@130.13 3.1.4...[color=blue]
      > "Penelope Baker" <penelopebaker@ chartermi.net> wrote in
      > news:1031rl2nr5 34176@corp.supe rnews.com:
      >[color=green]
      > > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every
      > > time the user rolls over a link, it rereads it from the server, even
      > > though it is well into the cache by that time. It works fine in
      > > Netscape, Mozilla, Firebird, Firefox, etc. Suggestions? (Other than
      > > the obvious one regarding IE :P)[/color]
      >
      > Have you tried emptying your cache first? IE6 does some rather weird
      > things (like not letting you view source) when its cache fills up.[/color]


      Comment

      • Jeroen Visser [ vizi ]

        #4
        Re: IE 6.0+ refuses to pre-cache images?

        In article <1031rl2nr53417 6@corp.supernew s.com>,
        "Penelope Baker" <penelopebaker@ chartermi.net> wrote:
        [color=blue]
        > I cannot seem to get IE 6.0 to pre-cache my rollover images.
        > Javascript for the rollover included below.[/color]

        <snip code>

        Preloading rollover states is unnecessary if you use some CSS:

        <http://www.pixy.cz/blogg/clanky/cssnopreloadrol lovers/>

        Rollovers, with no scripting and lean code. :-)

        Jeroen Visser

        --
        vizi fotografie & grafisch ontwerp

        I http://www.vizi.nl

        Comment

        • Penelope Baker

          #5
          Re: IE 6.0+ refuses to pre-cache images?

          Er, well, IE 6.0 SP1 or greater. Older versions seem fine.

          Peace,
          Pen

          "Penelope Baker" <penelopebaker@ chartermi.net> wrote in message
          news:1031skilec i4nc8@corp.supe rnews.com...[color=blue]
          > Yeah, this happens on everyone's computer.
          >
          > Peace,
          > Pen
          >
          > "Eric Bohlman" <ebohlman@earth link.net> wrote in message
          > news:Xns94916CB 9A1AF3ebohlmano msdevcom@130.13 3.1.4...[color=green]
          > > "Penelope Baker" <penelopebaker@ chartermi.net> wrote in
          > > news:1031rl2nr5 34176@corp.supe rnews.com:
          > >[color=darkred]
          > > > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every
          > > > time the user rolls over a link, it rereads it from the server, even
          > > > though it is well into the cache by that time. It works fine in
          > > > Netscape, Mozilla, Firebird, Firefox, etc. Suggestions? (Other than
          > > > the obvious one regarding IE :P)[/color]
          > >
          > > Have you tried emptying your cache first? IE6 does some rather weird
          > > things (like not letting you view source) when its cache fills up.[/color]
          >
          >[/color]


          Comment

          • Penelope Baker

            #6
            Re: IE 6.0+ refuses to pre-cache images?

            I've been considering that, but I kinda like the more ensured compatibility
            from the Javascript...

            Peace,
            Pen

            "Jeroen Visser [ vizi ]" <j.visser@vizi. nl> wrote in message
            news:j.visser-651658.17412316 022004@news.tud elft.nl...[color=blue]
            > In article <1031rl2nr53417 6@corp.supernew s.com>,
            > "Penelope Baker" <penelopebaker@ chartermi.net> wrote:
            >[color=green]
            > > I cannot seem to get IE 6.0 to pre-cache my rollover images.
            > > Javascript for the rollover included below.[/color]
            >
            > <snip code>
            >
            > Preloading rollover states is unnecessary if you use some CSS:
            >
            > <http://www.pixy.cz/blogg/clanky/cssnopreloadrol lovers/>
            >
            > Rollovers, with no scripting and lean code. :-)
            >
            > Jeroen Visser
            >
            > --
            > vizi fotografie & grafisch ontwerp
            >
            > I http://www.vizi.nl[/color]


            Comment

            • Michael Winter

              #7
              [OT - Corrections] Re: IE 6.0+ refuses to pre-cache images?

              On Mon, 16 Feb 2004 11:20:45 -0500, Penelope Baker
              <penelopebaker@ chartermi.net> wrote:
              [color=blue]
              > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time
              > the user rolls over a link, it rereads it from the server, even though
              > it is well into the cache by that time. It works fine in Netscape,
              > Mozilla, Firebird, Firefox, etc. Suggestions? (Other than the obvious
              > one regarding IE :P)[/color]

              [snip]
              [color=blue]
              > <SCRIPT LANGUAGE = "javascript ">[/color]

              You are using a deprecated attribute (language has been deprecated for
              over 6 years), but strangly missing a required one. The above should be:

              <script type="text/javascript">
              [color=blue]
              > <!--[/color]

              The practice of hiding scripts is unnecessary now, unless your target
              audience uses browsers that don't understand the SCRIPT element (they'd
              have to be very old, on the order of 10 or so years).

              [snip]
              [color=blue]
              > // Function to 'activate' images.
              >
              > function imgOn(imgName) {
              > if (document.image s) {
              > document[imgName].src = eval(imgName + "on.src");[/color]

              Why on Earth are you using eval()? imgName is a string, "on.src" is a
              string literal, and + can be (is) a string concatenation operator. Please
              explain why eval() is necessary.

              [snip]

              Mike

              --
              Michael Winter
              M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

              Comment

              • Jim Dabell

                #8
                Re: IE 6.0+ refuses to pre-cache images?

                Penelope Baker wrote:
                [color=blue]
                > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time
                > the user rolls over a link, it rereads it from the server, even though it
                > iswell into the cache by that time. It works fine in Netscape, Mozilla,
                > Firebird, Firefox, etc. Suggestions? (Other than the obvious one
                > regarding IE :P)[/color]

                It sounds like you are sending the wrong HTTP headers when you respond to
                image requests. Unless you post a link, it's impossible to say (that's
                part of the reason why posting a URL to a testcase is more likely to get
                you useful help here than pasting code).

                <URL:http://www.mnot.net/cache_docs/>

                --
                Jim Dabell

                Comment

                • Jeroen Visser [ vizi ]

                  #9
                  Re: IE 6.0+ refuses to pre-cache images?

                  In article <1031sp8pampmd7 6@corp.supernew s.com>,
                  "Penelope Baker" <penelopebaker@ chartermi.net> wrote:
                  [color=blue][color=green][color=darkred]
                  > > > I cannot seem to get IE 6.0 to pre-cache my rollover images.
                  > > > Javascript for the rollover included below.[/color]
                  > >
                  > > Preloading rollover states is unnecessary if you use some CSS:
                  > > <http://www.pixy.cz/blogg/clanky/cssnopreloadrol lovers/>[/color]
                  >
                  > I've been considering that, but I kinda like the more ensured compatibility
                  > from the Javascript...[/color]

                  Compatibility with what? CSS rollovers work in Opera 7, Mozilla, Safari,
                  Firefox, IE5.5+, IE5.x/Mac and more. Usage statisticss of Netscape 4.x,
                  IE4.x and other 4th generation browsers are steadily declining; besides:
                  the CSS solution degrades rather nicely. Presentation might be lost, but
                  content and meaning are preserved.

                  Jeroen Visser

                  --
                  vizi fotografie & grafisch ontwerp

                  I http://www.vizi.nl

                  Comment

                  • Jim Dabell

                    #10
                    Re: IE 6.0+ refuses to pre-cache images?


                    [Please don't post upside down.]

                    Penelope Baker wrote:
                    [color=blue]
                    > "Jeroen Visser [ vizi ]" <j.visser@vizi. nl> wrote in message
                    > news:j.visser-651658.17412316 022004@news.tud elft.nl...[/color]
                    [snip][color=blue][color=green]
                    >> Preloading rollover states is unnecessary if you use some CSS:
                    >>
                    >> <http://www.pixy.cz/blogg/clanky/cssnopreloadrol lovers/>
                    >>
                    >> Rollovers, with no scripting and lean code. :-)[/color]
                    >
                    > I've been considering that, but I kinda like the more ensured
                    > compatibility from the Javascript...[/color]

                    There's nothing "ensured" about Javascript. CSS rollovers work in the vast
                    majority of browsers you are likely to encounter, and are far less likely
                    to be deliberately switched off or filtered out than Javascript. Expect
                    CSS rollovers to be more "compatible " than Javascript rollovers in the near
                    future, if they aren't already.

                    Plus, there's the added bonus of not having to mess around with the HTML,
                    unlike your current approach (although, given better Javascript, this would
                    be unnecessary with that too).


                    --
                    Jim Dabell

                    Comment

                    • Penelope Baker

                      #11
                      Re: IE 6.0+ refuses to pre-cache images?

                      Thank you all.

                      Peace,
                      Penelope

                      "Penelope Baker" <penelopebaker@ chartermi.net> wrote in message
                      news:1031rl2nr5 34176@corp.supe rnews.com...[color=blue]
                      > Greetings:
                      >
                      > I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time
                      > the
                      > user rolls over a link, it rereads it from the server, even though it is
                      > well into the cache by that time. It works fine in Netscape, Mozilla,
                      > Firebird, Firefox, etc. Suggestions? (Other than the obvious one
                      > regarding
                      > IE :P)
                      >
                      > Thanks!
                      >
                      > Peace,
                      > Pen
                      >
                      > Javascript for the rollover included below.
                      >
                      >
                      > <head>
                      > <SCRIPT LANGUAGE = "javascript ">
                      > <!--
                      >
                      > if (document.image s) { // Active Images
                      > img1on = new Image();
                      > img1on.src = "images/right_buttoncap _rollover.gif";
                      >
                      > img1off = new Image();
                      > img1off.src = "images/right_buttoncap .gif";
                      >
                      > img2on = new Image();
                      > img2on.src = "images/right_buttoncap _rollover.gif";
                      >
                      > img2off = new Image();
                      > img2off.src = "images/right_buttoncap .gif";
                      >
                      > img3on = new Image();
                      > img3on.src = "images/right_buttoncap _rollover.gif";
                      >
                      > img3off = new Image();
                      > img3off.src = "images/right_buttoncap .gif";
                      >
                      > img4on = new Image();
                      > img4on.src = "images/right_buttoncap _rollover.gif";
                      >
                      > img4off = new Image();
                      > img4off.src = "images/right_buttoncap .gif";
                      >
                      > img5on = new Image();
                      > img5on.src = "images/right_buttoncap _rollover.gif";
                      >
                      > img5off = new Image();
                      > img5off.src = "images/right_buttoncap .gif";
                      > }
                      >
                      > // Function to 'activate' images.
                      >
                      > function imgOn(imgName) {
                      > if (document.image s) {
                      > document[imgName].src = eval(imgName + "on.src");
                      > }
                      > }
                      >
                      > // Function to 'deactivate' images.
                      >
                      > function imgOff(imgName) {
                      > if (document.image s) {
                      > document[imgName].src = eval(imgName + "off.src");
                      > }
                      > }
                      >
                      > window.onerror= null;
                      > // -->
                      > </SCRIPT>
                      >
                      > </head>
                      >
                      > <body>
                      > <a href="#top" onMouseOver="im gOn('img1')" onMouseOut="img Off('img1')"
                      > class="subnav_l ink">Latest News</a>
                      >
                      >[/color]


                      Comment

                      • Penelope Baker

                        #12
                        Re: IE 6.0+ refuses to pre-cache images?

                        The CSS based solution shows the same problem on the same browsers on
                        multiple different servers (that I do and do not control). Thus it is not a
                        header problem, nor a code problem, nor something that can be solved with
                        CSS. I think something is el funk with this latest security update on IE...

                        Peace,
                        Pen


                        "Jeroen Visser [ vizi ]" <j.visser@vizi. nl> wrote in message
                        news:j.visser-23DDB6.18472916 022004@news.tud elft.nl...[color=blue]
                        > In article <1031sp8pampmd7 6@corp.supernew s.com>,
                        > "Penelope Baker" <penelopebaker@ chartermi.net> wrote:
                        >[color=green][color=darkred]
                        >> > > I cannot seem to get IE 6.0 to pre-cache my rollover images.
                        >> > > Javascript for the rollover included below.
                        >> >
                        >> > Preloading rollover states is unnecessary if you use some CSS:
                        >> > <http://www.pixy.cz/blogg/clanky/cssnopreloadrol lovers/>[/color]
                        >>
                        >> I've been considering that, but I kinda like the more ensured
                        >> compatibility
                        >> from the Javascript...[/color]
                        >
                        > Compatibility with what? CSS rollovers work in Opera 7, Mozilla, Safari,
                        > Firefox, IE5.5+, IE5.x/Mac and more. Usage statisticss of Netscape 4.x,
                        > IE4.x and other 4th generation browsers are steadily declining; besides:
                        > the CSS solution degrades rather nicely. Presentation might be lost, but
                        > content and meaning are preserved.
                        >
                        > Jeroen Visser
                        >
                        > --
                        > vizi fotografie & grafisch ontwerp
                        >
                        > I http://www.vizi.nl[/color]


                        Comment

                        Working...