Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Question, need expert help pre-loading images properly (IE + FireFox), thank you :)

Reply
Thread Tools

Question, need expert help pre-loading images properly (IE + FireFox), thank you :)

 
 
SaraLeePerson@gmail.com
Guest
Posts: n/a
 
      10-25-2007
Dear group,

I am seeking a easy to maintain and more importantly *working* way to
pre-fetch images, so the pages I develop load smoothly without seeing
the images kick in flicker as they usually do. Important - I need
this to work on Internet Explorer 6.0+ and FireFox.

I am presently using at the head of the page,

pic100= new Image;
pic100.src="./imageme.gif";

However, it doesn't seem to work on FireFox at all. I've tried
different combinations with the URL path, but I don't know what I am
doing wrong. Can someone please assist me with this boggle?

Thank you very much in advance for any assistance.

Best wishes, Sara.

 
Reply With Quote
 
 
 
 
Stevo
Guest
Posts: n/a
 
      10-25-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> pic100= new Image;
> pic100.src="./imageme.gif";
> However, it doesn't seem to work on FireFox at all. I've tried
> Thank you very much in advance for any assistance.


I could be wrong and using new Image; is just fine, but I've always used
new Image();

You didn't mention how you use pic100 so that's all there is to go on.
 
Reply With Quote
 
 
 
 
SaraLeePerson@gmail.com
Guest
Posts: n/a
 
      10-25-2007

> I could be wrong and using new Image; is just fine, but I've always used
> new Image();
>
> You didn't mention how you use pic100 so that's all there is to go on.


Hi

Presently, the configuration for FireFox and IE I have is

<script>
pic100= new Image;
pic100.src="./imageme.gif";
</script>

<img src=./imageme.gif>

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      10-25-2007
(E-Mail Removed) wrote:
> I am seeking a easy to maintain and more importantly *working* way to
> pre-fetch images, so the pages I develop load smoothly without seeing
> the images kick in flicker as they usually do.


Please don't.

> Thank you very much in advance for any assistance.


You're welcome.


F'up2 cljs

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
Stevo
Guest
Posts: n/a
 
      10-25-2007
(E-Mail Removed) wrote:
> <script>
> pic100= new Image;
> pic100.src="./imageme.gif";
> </script>
>
> <img src=./imageme.gif>


OK, you're expectations are too high. That pic100.src *is* starting to
preload the file, but your img tag is going to start using it long
before it will be finished loading. What people usually do in cases like
this is to set the img src to a blank image, and only when pic100.src
has finished loading, do you then change the src of the img to point to
it. If you google "preload images javascript" you'll find lots of
ready-coded examples.
 
Reply With Quote
 
Peter Michaux
Guest
Posts: n/a
 
      10-26-2007
On Oct 25, 11:50 am, (E-Mail Removed) wrote:
> Dear group,
>
> I am seeking a easy to maintain and more importantly *working* way to
> pre-fetch images, so the pages I develop load smoothly without seeing
> the images kick in flicker as they usually do. Important - I need
> this to work on Internet Explorer 6.0+ and FireFox.
>
> I am presently using at the head of the page,
>
> pic100= new Image;
> pic100.src="./imageme.gif";


I'm rewriting some old preload code to try to reduce server
connections. For some reason, after the window.onload event, each use
of the following code

var img = new Image();
img.src = someUrl;

causes a new connection to the server (Apache). Because many (~100)
images now need to be preloaded, this is causing Apache grief. (I
didn't write the specs on this page. It is legacy and needs a quick
fix until I have time for a real solution.)

If the same many images are just written into the page with <img
src="someUrl"> the same initial connection is being used to get all
images. I believe this is Apache's pipelining feature at work to
conserve connections.

Does anyone know about this situation and is their a standard
solution?

I have a few ideas to try when the server admin is available but I
thought I'd ask since the topic has appeared.

Thanks,
Peter


 
Reply With Quote
 
SAM
Guest
Posts: n/a
 
      10-27-2007
Peter Michaux a écrit :
>
> I'm rewriting some old preload code to try to reduce server
> connections. For some reason, after the window.onload event, each use
> of the following code
>
> var img = new Image();
> img.src = someUrl;
>
> causes a new connection to the server (Apache). Because many (~100)
> images now need to be preloaded, this is causing Apache grief.


And post-writing css rules (or post-writing a call to a *.css) for this
100 images as backrground of the same transparent image opened in the page ?
(probably they won't appear in order)

--
SM
 
Reply With Quote
 
Bone Ur
Guest
Posts: n/a
 
      10-28-2007
On Fri, 26 Oct 2007 00:25:53 GMT Peter Michaux wrote:

>> I am seeking a easy to maintain and more importantly *working* way to
>> pre-fetch images, so the pages I develop load smoothly without seeing
>> the images kick in flicker as they usually do. Important - I need
>> this to work on Internet Explorer 6.0+ and FireFox.
>>
>> I am presently using at the head of the page,
>>
>> pic100= new Image;
>> pic100.src="./imageme.gif";

>
> I'm rewriting some old preload code to try to reduce server
> connections. For some reason, after the window.onload event, each use
> of the following code
>
> var img = new Image();
> img.src = someUrl;
>
> causes a new connection to the server (Apache). Because many (~100)
> images now need to be preloaded, this is causing Apache grief. (I
> didn't write the specs on this page. It is legacy and needs a quick
> fix until I have time for a real solution.)
>
> If the same many images are just written into the page with <img
> src="someUrl"> the same initial connection is being used to get all
> images. I believe this is Apache's pipelining feature at work to
> conserve connections.
>
> Does anyone know about this situation and is their a standard
> solution?
>
> I have a few ideas to try when the server admin is available but I
> thought I'd ask since the topic has appeared.


You can j/s preload sequentially: ie, not starting the following preload
until the previous is finished. I've done that and it works. But a
better idea (I think) is just to make a position:absolute;
visibility:hidden; div "layer" encompassing all the images which won't
show because of the css.

--
Bone Ur
Cavemen have stronger pheromones.
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      10-28-2007
On Oct 27, 10:02 pm, Bone Ur <(E-Mail Removed)> wrote:
> On Fri, 26 Oct 2007 00:25:53 GMT Peter Michaux wrote:
>
>
>
>
>
> >> I am seeking a easy to maintain and more importantly *working* way to
> >> pre-fetch images, so the pages I develop load smoothly without seeing
> >> the images kick in flicker as they usually do. Important - I need
> >> this to work on Internet Explorer 6.0+ and FireFox.

>
> >> I am presently using at the head of the page,

>
> >> pic100= new Image;
> >> pic100.src="./imageme.gif";

>
> > I'm rewriting some old preload code to try to reduce server
> > connections. For some reason, after the window.onload event, each use
> > of the following code

>
> > var img = new Image();
> > img.src = someUrl;

>
> > causes a new connection to the server (Apache). Because many (~100)
> > images now need to be preloaded, this is causing Apache grief. (I
> > didn't write the specs on this page. It is legacy and needs a quick
> > fix until I have time for a real solution.)

>
> > If the same many images are just written into the page with <img
> > src="someUrl"> the same initial connection is being used to get all
> > images. I believe this is Apache's pipelining feature at work to
> > conserve connections.

>
> > Does anyone know about this situation and is their a standard
> > solution?

>
> > I have a few ideas to try when the server admin is available but I
> > thought I'd ask since the topic has appeared.

>
> You can j/s preload sequentially: ie, not starting the following preload
> until the previous is finished. I've done that and it works. But a
> better idea (I think) is just to make a position:absolute;
> visibility:hidden; div "layer" encompassing all the images which won't
> show because of the css.


That will mess up the semantics of the page and will look strange when
style is disabled. For the scriptless approach, it is better to use
background images.

 
Reply With Quote
 
Bone Ur
Guest
Posts: n/a
 
      10-29-2007
Well bust mah britches and call me cheeky, on Sun, 28 Oct 2007 08:57:45 GMT
David Mark scribed:

>> You can j/s preload sequentially: ie, not starting the following preload
>> until the previous is finished. I've done that and it works. But a
>> better idea (I think) is just to make a position:absolute;
>> visibility:hidden; div "layer" encompassing all the images which won't
>> show because of the css.

>
> That will mess up the semantics of the page and will look strange when
> style is disabled. For the scriptless approach, it is better to use
> background images.


Background images don't always load as one might wish, though. The
styling-disabled is a valid concern, but despite conventional mythology,
styling is necessary nowadays and anyone who disables it except for testing
is a moron. As for semantics - phffft! Very few pages have correct
semantics, anyway, and a sequential list of links in a "layer" will
certainly not mess them up if they are correct.

--
Bone Ur
Cavemen have stronger pheromones.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question, need expert help pre-loading images properly (IE + FireFox), thank you :) SaraLeePerson@gmail.com Javascript 29 10-31-2007 12:57 AM
Need Expert Help and Advice. Thank You. shapper ASP .Net 7 02-27-2007 05:51 PM
Preload Images. Please, help me out. Thank You. shapper Javascript 4 11-26-2006 02:10 PM
Thank You CJ, Thank Mike! mytho Computer Support 7 11-23-2003 06:50 AM



Advertisments