Important alert: (current site time 7/15/2013 12:01:52 PM EDT)
 

winzip icon

A "True" Preloader!!

Email
Submitted on: 4/24/2003 2:46:21 PM
By: UnholyAngl 
Level: Beginner
User Rating: By 11 Users
Compatibility: JavaScript
Views: 33557
(About the author)
 
     Here is the best way I have found to preload images in jscript. This method also works with Flash movies, and can be customized to preload virtually anything!! It is pretty easy to use, and I tried to comment all of the code so everyone can understand what is going on.
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :A "True" Preloader!!
'**************************************
This preloader is pretty easy to use... Download the .zip, customize the preloader.js file to load your files and your set!!
Leave a comment and vote!! lol, I'm not plannin on winnin with this, but hey, it's nice to get some ppl sayin how this sux so I can improve on it :-D
By the way... This was tested and designed in IE6, but should work with almost all browsers.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
4/25/2003 12:47:16 PMUnholyAngl

Some feedback and/or votes would be nice ^ ^
(If this comment was disrespectful, please report it.)

 
4/30/2003 8:37:58 PMUnholyAngl

I'm not sure, a friend needed this. And it makes the index.html much smaller when you have a very large site and you need to preload pretty much everything on it.

The other ways to preload (creating an image variable, etc) are a waste. It starts loading them after the page has loaded, which is a pain in the ars with roll over images if you put the preloader directly on a main page.

There are many other reasons why I feel a java script is much better than putting the html on the page.
(If this comment was disrespectful, please report it.)

 
4/30/2003 8:39:35 PMUnholyAngl

but, I have alot of coding to do right now on a site. So, maybe I'll mention some more reasons later, hehe
(If this comment was disrespectful, please report it.)

 
5/22/2003 7:59:59 AMSeb Ramadan (s00p)

Nice work with the
Wow! What a call! Im sittin here looking for a preloader that (sheesh) works and doesnt look like some newb has just copied it (no offence to anyone. All decent posts) and... Well I guess its half decent to read the posts most of the time hey? Ill check the JS preloader out later...
(If this comment was disrespectful, please report it.)

 
8/2/2003 4:40:18 PM

Good work!Thanks.
(If this comment was disrespectful, please report it.)

 
3/23/2004 3:06:20 AM

It works perfect. Was searching for a preloader for swf all day yesterday. And your script is excellent! I miss one thing though, a status bar, does anyone know how to combine this with the preloader code?
(If this comment was disrespectful, please report it.)

 
4/27/2004 6:06:55 AM

I think this is excellent!
Thumbs up for well documented and written code which works! If you added a status bar as well it would be brilliant!
(If this comment was disrespectful, please report it.)

 
8/31/2004 3:55:40 PMUnholyAngl

Thanks for all the great comments.
Sry for not replying, i forgot that i ever posted anything here.

Maybe i'll whip up a new version of it one of these days, with a status bar and such.

Note: I removed the ungreatfull bashing comments, because they mainly made no sense and were just putting the script down. I put this simple script up for people to learn from and to use! Not for ret@rds to bash it...
(If this comment was disrespectful, please report it.)

 
6/8/2005 7:59:15 AM

very nice coding. 5Gs
(If this comment was disrespectful, please report it.)

 
8/24/2005 11:30:22 PMTheresa

This is a really cool script! I have a couple of questions, what do I use as the type to preload a wmv file? ("image" or "movie" etc) and is there a way to set a delay as I want to show an intro while the file is loading. Its a very large video so I need something to display first....THanks!
(If this comment was disrespectful, please report it.)

 
1/18/2006 11:59:14 AMtuat

thich CNTT
(If this comment was disrespectful, please report it.)

 
11/30/2006 1:57:19 AMsunmicro

the thing is it preloads the images..bt when it redirects to the main page the images again start to load...i dnt knw if it loads from cache..
i`ve made 2 pages default.asp page being the preload and index.asp being the main..however it does not work..in index.asp again the images start to load....ANY SOLUTIONS????GUYS....??
(If this comment was disrespectful, please report it.)

 
12/12/2006 1:20:14 AM

thx for sharing with us, try to extrct files now. My first exp preloader with form java.Keep up u'r good job
(If this comment was disrespectful, please report it.)

 
3/7/2007 4:23:10 PMgadzanani

dont know waht this does

(If this comment was disrespectful, please report it.)

 
5/12/2008 10:38:47 PMVince Hahn

this is some good codin'. not the greatest but it does what it's supposed to do. (i took the liberty of testing it in opera safari and firefox, none came up with errors (js error display=on), however it didn't display correctly in opera 9, and the quality all but sucked (for images) in safari 3. But I'm still impressed. It streamlined the process much, mainly because you've done all the work :P. I ultimately didn't use this script because I ended up going with a very light-on-the-graphics design for my site. Still, nice work. 4 globes.
(If this comment was disrespectful, please report it.)

 
4/14/2009 2:01:22 AMlee

please send me a lot of source code about javascript I very interest about it,.
thanks for all,..
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.