Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4015322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:36:18+00:00 2026-05-20T09:36:18+00:00

Currently I am using a pretty basic function to pre-load images: function preload(arrayOfImages) {

  • 0

Currently I am using a pretty basic function to pre-load images:

    function preload(arrayOfImages) {
        $(arrayOfImages).each(function(){
            $('<img/>')[0].src = this;
            // Alternatively you could use:
            // (new Image()).src = this;
        });
    }

    // Usage:

    preload([
        'img/imageName.jpg',
        'img/anotherOne.jpg',
        'img/blahblahblah.jpg'
]);

I have a fairly large number of small images I need to pre-load (all far under 1MB when combined), and was wondering if there was a way to do so without declaring each image individually.

Any advice would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:36:19+00:00Added an answer on May 20, 2026 at 9:36 am

    You could use a loader-script like supplyJS. This is pretty useful, when loading lots of “smallish” images, because it’s much faster.

    Demo: http://www.typeofnan.com/lab/mxhr-stream/

    The loading would look like:

    supply.listen('image/jpg', function(payload, filename) {
        jQuery('<img>', {
            src: 'data:image/jpeg;base64,' + payload
        }).appendTo(document.body);;
    });
    
    supply.setDealer('/cgi-bin/supply.pl').files({
        images: [
            '/images/foo.jpg',
            '/images/bar.jpg',
            '/images/another.jpg'
        ]
    });
    

    This example would directly append the newly loaded images to the document.body. Of course you could do anything with those in the mime-type-listener.
    Admittedly, this also requires to specify each image explicitly but it should be a whole lot faster.

    ..and by the way, perhaps the author of supplyJS will add a *.jpg for instance, because that’s actually a great idea 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently i'm using pretty much Unix + Mysql + Perl + Apache with some
So this question is probably pretty basic. I am wanting to create an array
I'm currently using TinyMCE 3 on a site, but have noticed it's pretty bloated
I know this is a pretty basic question, but I don't know how to
I have been using PRETTY_FUNCTION to output the current function name, however I have
I have a pretty standard table set-up in a current application using the .NET
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather
I am currently using Windows Server 2008 Standard and have several Hyper V machines.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.