By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,246 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,246 IT Pros & Developers. It's quick & easy.

IE 6.0+ refuses to pre-cache images?

P: n/a
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.images) { // 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.images) {
document[imgName].src = eval(imgName + "on.src");
}
}

// Function to 'deactivate' images.

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

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

</head>

<body>
<a href="#top" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')"
class="subnav_link">Latest News</a>
Jul 20 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
"Penelope Baker" <pe***********@chartermi.net> wrote in
news:10*************@corp.supernews.com:
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)


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

P: n/a
Yeah, this happens on everyone's computer.

Peace,
Pen

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn*******************************@130.133.1.4 ...
"Penelope Baker" <pe***********@chartermi.net> wrote in
news:10*************@corp.supernews.com:
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)


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

Jul 20 '05 #3

P: n/a
In article <10*************@corp.supernews.com>,
"Penelope Baker" <pe***********@chartermi.net> wrote:
I cannot seem to get IE 6.0 to pre-cache my rollover images.
Javascript for the rollover included below.


<snip code>

Preloading rollover states is unnecessary if you use some CSS:

<http://www.pixy.cz/blogg/clanky/cssnopreloadrollovers/>

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

Jeroen Visser

--
vizi fotografie & grafisch ontwerp

I http://www.vizi.nl
Jul 20 '05 #4

P: n/a
Er, well, IE 6.0 SP1 or greater. Older versions seem fine.

Peace,
Pen

"Penelope Baker" <pe***********@chartermi.net> wrote in message
news:10*************@corp.supernews.com...
Yeah, this happens on everyone's computer.

Peace,
Pen

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn*******************************@130.133.1.4 ...
"Penelope Baker" <pe***********@chartermi.net> wrote in
news:10*************@corp.supernews.com:
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)


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


Jul 20 '05 #5

P: n/a
I've been considering that, but I kinda like the more ensured compatibility
from the Javascript...

Peace,
Pen

"Jeroen Visser [ vizi ]" <j.******@vizi.nl> wrote in message
news:j.****************************@news.tudelft.n l...
In article <10*************@corp.supernews.com>,
"Penelope Baker" <pe***********@chartermi.net> wrote:
I cannot seem to get IE 6.0 to pre-cache my rollover images.
Javascript for the rollover included below.


<snip code>

Preloading rollover states is unnecessary if you use some CSS:

<http://www.pixy.cz/blogg/clanky/cssnopreloadrollovers/>

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

Jeroen Visser

--
vizi fotografie & grafisch ontwerp

I http://www.vizi.nl

Jul 20 '05 #6

P: n/a
On Mon, 16 Feb 2004 11:20:45 -0500, Penelope Baker
<pe***********@chartermi.net> wrote:
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)
[snip]
<SCRIPT LANGUAGE = "javascript">
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">
<!--
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]
// Function to 'activate' images.

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


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.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #7

P: n/a
Penelope Baker wrote:
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)


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

Jul 20 '05 #8

P: n/a
In article <10*************@corp.supernews.com>,
"Penelope Baker" <pe***********@chartermi.net> wrote:
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/cssnopreloadrollovers/>


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


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
Jul 20 '05 #9

P: n/a

[Please don't post upside down.]

Penelope Baker wrote:
"Jeroen Visser [ vizi ]" <j.******@vizi.nl> wrote in message
news:j.****************************@news.tudelft.n l...

[snip]
Preloading rollover states is unnecessary if you use some CSS:

<http://www.pixy.cz/blogg/clanky/cssnopreloadrollovers/>

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


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


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

Jul 20 '05 #10

P: n/a
Thank you all.

Peace,
Penelope

"Penelope Baker" <pe***********@chartermi.net> wrote in message
news:10*************@corp.supernews.com...
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.images) { // 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.images) {
document[imgName].src = eval(imgName + "on.src");
}
}

// Function to 'deactivate' images.

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

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

</head>

<body>
<a href="#top" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')"
class="subnav_link">Latest News</a>

Jul 20 '05 #11

P: n/a
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.******@vizi.nl> wrote in message
news:j.****************************@news.tudelft.n l...
In article <10*************@corp.supernews.com>,
"Penelope Baker" <pe***********@chartermi.net> wrote:
> > 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/cssnopreloadrollovers/>


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


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

Jul 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.