Using this script we can load an image in to a cache and display it when needed.Once you click the button the second image will display immediately with out any delay as it comes from the cache. If your internet connection is slow then you can see the difference clearly. If you are in a fast net then try to connect to a heavy image to get the difference in speed. Now check out our JavaScript image slide show. Here is the complete code for caching of image.
<html>
<head>
<title>Image Caching from mistonline.in</title>
<script language="JavaScript">
//refer mistonline.in for more detailed scripts
objImage = new Image();
function download(){
// preload the image file
objImage.src="http://www.youwebsitename.com/image/2326.jpg";
}
function displayimage(){
document.images[''im''].src = "http://www.youwebsitename.com/image/2326.jpg";
}
</script></head>
<body onLoad="download()">
<form name="f1?>
<img name="im" src=http://localhost/image/1263.jpg/><br />
<input type="button" name="Prev" value=" Show Image " onClick="displayimage()"/>
</form>
</body>
</html>
Incoming search terms:
- javascript image cache (14)
- javascript cache images (10)
- javascript image caching (8)
- cache image javascript (5)
- js image cache (5)
- javascript image object (5)
- image caching in javascript (4)
- cache images javascript (4)
- javascript caching images (3)
- javascript object cache (3)
- image caching javascript (3)
- how to cache images in javascript (3)
- caching images in javascript (3)
- cache images using javascript (3)
- javascript cache image object (2)
- java image caching (2)
- javascript – image caching (2)
- cache images html javascript (2)
- javascript display image object (2)
- javascript image object caching (2)
- javascript use image cache (2)
- javascript cache image (2)
- javascript image caching jquery (1)
- javascript image cashing (1)
- javascript image chach (1)
- javascript cachen (1)
- javascript cache image object complete (1)
- javascript check image is in cache (1)
- javascript check image cache (1)
- javascript cache tutorial (1)
- javascript cache code for images (1)
- javascript image object application cache (1)
- javascript switching images cache (1)
- javascript using image from cache (1)
- jquery swap image cache (1)
- js how to caching an image (1)
- load web image panda3D (1)
- reading image file in object using js (1)
- show cached javascript images (1)
- tuto javascript jsp image onclick (1)
You will also be interested in ,
- Javascript setTimeout() Tricks
- To Remove An Empty Element From An Array Using PHP
- Url rewriting examples using .htaccess
- C sharp INTERVIEW QUESTIONS
- Display Tags in wordpress
- Displaying or changing images each day
- MD5 Function and Unique ID in php
- .htaccess some facts and rules
- Get Method and Array Manipulation In Symfony
- Simple Javascript Slideshow
