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 987201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:26:31+00:00 2026-05-16T05:26:31+00:00

hi am using this snippet for preload image using javascript window.onload=function(){ heavyImage.src = images/qq-lookupbody-holder.png;

  • 0

hi am using this snippet for preload image using javascript

window.onload=function(){

heavyImage.src = "images/qq-lookupbody-holder.png"; (ON PAGE LOAD)

}

But am not find any different after i added this js snippet,

Is there any way to check , the preloader script is really worht or not….

  • 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-16T05:26:32+00:00Added an answer on May 16, 2026 at 5:26 am

    If you’re doing it in a page “load” handler, it won’t help because “load” isn’t called until the images are ready. Call it before that, however, and it could make a difference, maybe, though one way or the other the browser has to fetch the image. Things like that can help when you preload images for other pages on your site. That gets them into the browser cache, so that when the user reaches a page that actually uses the image, it’s cached.

    Also, you didn’t post it, but I assume that the line of code you supplied actually follows a line where “heavyImage” is set to an actual “Image” instance:

    heavyImage = new Image();
    

    edit — well after your update I can tell you that under no circumstances will that code help to load your image. Again, you can try this:

    var heavyImage = new Image();
    heavyImage.src = "images/qq-lookupbody-holder.png";
    

    Don’t put that in an “onload” handler however. Just put it in a <script> block in the <head> of the document. Still, it may or may not really help. If you can arrange to preload the image on a page before your site visitor reaches the page with the image, then that could make a big difference.

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

Sidebar

Related Questions

I currently am using this JavaScript code snippet to select 3 checkboxes at a
I'm using this snippet to bind on select event: $(#myTabControl).tabs({ select: function(event, ui){ var
So, I using this snippet <tr onclick=this.toggleClassName('selected')> on a web page. (a Prototype.js function)
I'm using this snippet to add a class based on its id: $('.block').click(function() {
In chrome browser, when using this snippet: $(document).on('keyup', function(){ alert(Hey); }); Every time I
I am using this code snippet to add KeyDown event handler to any element
I'm using this jQuery snippet to create tooltips on some JSF primefaces elements in
In the tableView:cellForRowAtIndexPath: implementation of my UITableViewController subclass I'm using this code snippet: AlarmPicker
how i do validate two date textboxes using jquery. i came across this snippet
This is the snippet of code i'm using now: def countOccurences(a, b) #counts the

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.