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

  • SEARCH
  • Home
  • 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 am using this query, which does a pretty good job of finding
I'm currently porting a pretty basic gallery application from PHP to Go. This application
I built a pretty basic dynamic AJAX function to load in content onto the
Currently using MySQL version 5.1.6 This is my first real world build and so
So I'm pretty new to Visual Basic and inherited this VB6 code that i
So this question is probably pretty basic. I am wanting to create an array
I have two basic bar charts and I am currently using XML/SWF Charts which
I am trying to do something pretty basic here. I am using a block-based
I know this is a pretty basic question, and I think I know the
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted

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.