Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 10:02 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Preloading Images javascript code
PostPosted: Sun Oct 19, 2008 11:55 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

If you're looking for a way to speed up your web site's perceived load time, preloading your images may be your answer. By using the following JavaScript code, you can preload the images you specify prior to your web page opening. This will enable your images to promptly display instead of your visitors having to wait for them to load.

Place this code between your <HEAD> and </HEAD> tags:

Code:
<SCRIPT language="JavaScript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
var preload=new Image();
preload.src="(image.gif)";
// -->
</SCRIPT>


Edit the text indicated in red to your image file name.

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Preloading Images javascript code
PostPosted: Sun Jan 11, 2009 5:01 pm 
Offline
Newbie
User avatar

Joined: Sun Jan 11, 2009 4:56 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
If i am to use this code for upload of multiple images how do i go about separating the image files in the Javascript?

Do i use a comma e.g,

preload.src="(image1.gif, image2.gif)"

or

preload.src="(image1.gif)(image2.gif)"

Im new to Javascript and realise i should know this.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 upload and download images in my jsp page.
 Exporting Images in Excel in Android
 Read your gmail using Java code
 Code to open multiple links.
 I need help with checkers code
 java code for listing folder contents from remote folder
 code for online payment system in java
 JavaScript fade out problem
 apriori algorithm java code
 playfair cipher assembly code

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team