Preload many images

Discussion in 'Javascript' started by Albert Spencil, May 15, 2004.

  1. I have tried several preload scripts found here; plus, some of my own.
    The only thing that works is the unsophisticated loading of those
    tiny images. The download consist of 100+ images amounting to 50+mb;
    and, normally completes in less than 1 minute without preload (using
    DSL). The preload terminates after 6 or 7
    images and seems to time-out in the middle of an image. A reload will
    download a few more, etc. I have used the <body onLoad=function()>
    approach as well as the
    non-function approach of JS that executes immediately with the page's
    loading.
    Getting the same results with Netscape-7 and IE-6.

    I need to add: The source of the array containing the image
    references is a '.js' file. That doesn't seem pertinent as some of the
    images always load.

    Got any ideas??

    Tx Albert Spencil
    Albert Spencil, May 15, 2004
    #1
    1. Advertising

  2. Albert Spencil

    Juliette Guest

    Albert Spencil wrote:
    >
    > I have tried several preload scripts found here; plus, some of my own.
    > The only thing that works is the unsophisticated loading of those
    > tiny images. The download consist of 100+ images amounting to 50+mb;
    > and, normally completes in less than 1 minute without preload (using
    > DSL). The preload terminates after 6 or 7
    > images and seems to time-out in the middle of an image. A reload will
    > download a few more, etc. I have used the <body onLoad=function()>
    > approach as well as the
    > non-function approach of JS that executes immediately with the page's
    > loading.
    > Getting the same results with Netscape-7 and IE-6.
    >
    > I need to add: The source of the array containing the image
    > references is a '.js' file. That doesn't seem pertinent as some of the
    > images always load.
    >
    > Got any ideas??
    >
    > Tx Albert Spencil


    Albert,

    If you show us some code, we may be able to help.

    J.
    Juliette, May 16, 2004
    #2
    1. Advertising

  3. Juliette <"jrf[spamblock]"@jokeaday.net> wrote in message news:<>...
    > Albert Spencil wrote:
    > >
    > > I have tried several preload scripts found here; plus, some of my own.
    > > The only thing that works is the unsophisticated loading of those
    > > tiny images. The download consist of 100+ images amounting to 50+mb;
    > > and, normally completes in less than 1 minute without preload (using
    > > DSL). The preload terminates after 6 or 7
    > > images and seems to time-out in the middle of an image. A reload will
    > > download a few more, etc. I have used the <body onLoad=function()>
    > > approach as well as the
    > > non-function approach of JS that executes immediately with the page's
    > > loading.
    > > Getting the same results with Netscape-7 and IE-6.
    > >
    > > I need to add: The source of the array containing the image
    > > references is a '.js' file. That doesn't seem pertinent as some of the
    > > images always load.
    > >
    > > Got any ideas??
    > >
    > > Tx Albert Spencil

    >
    > Albert,
    >
    > If you show us some code, we may be able to help.
    >
    > J.


    OK. This is a very simple one. For NS4.7 it preloads anywhere from 2
    to all (79). For NS7x it preloaded 7 and on restores it downloaded a
    few more each time. For IE6 it consistently preloads just the last
    image (#79).

    <script src='imageFile.js'></script> // contains the array 'pics'
    <script language='javascript'><!--
    /*-------------Function to preload images----------------*/

    function doPreload()
    {

    for(loop = 0; loop < pics.length; loop++)
    {
    var an_image = new Image();
    an_image.src = pics[loop];
    }
    }
    /*-------------------------------------------------------------------*/
    //-->
    </script>
    </head>
    <body onLoad=doPreload() bgcolor="#004f00" text="#ffffff"
    link="#ffffff" vlink="ffffff" alink="ffff48">
    Albert Spencil, May 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Morris

    preload images

    Morris, Nov 12, 2003, in forum: HTML
    Replies:
    5
    Views:
    588
    Beauregard T. Shagnasty
    Nov 14, 2003
  2. ks
    Replies:
    1
    Views:
    362
    Mark Rae
    Aug 5, 2006
  3. shapper
    Replies:
    4
    Views:
    4,030
    Laurent Bugnion
    Nov 25, 2006
  4. =?Utf-8?B?Q2FzcGE=?=

    Preload images returned by an HttpHandler

    =?Utf-8?B?Q2FzcGE=?=, Mar 9, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    377
    Chilumba Mubashi [MSFT]
    Mar 28, 2007
  5. Mark

    Preload TreeView images

    Mark, Feb 13, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    182
    Teemu Keiski
    Feb 14, 2004
Loading...

Share This Page