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 (17)
- javascript cache images (11)
- javascript image caching (10)
- cache image javascript (6)
- js image cache (5)
- javascript image object (5)
- image caching in javascript (4)
- cache images javascript (4)
- image caching javascript (3)
- how to cache images in javascript (3)
- javascript object cache (3)
- caching images in javascript (3)
- javascript caching images (3)
- image cache in javascript (2)
- how to cache image in javascript (2)
- javascript image object caching (2)
- javascript cache tutorial (2)
- javascript cache image object (2)
- javascript use image cache (2)
- javascript cache image (2)
- cache images html javascript (2)
- java image caching (2)
- youwebsitename com (2)
- javascript – image caching (2)
- javascript image in cache (1)
- javascript image cashing (1)
- javascript dynamic image caching (1)
- javascript dynamic image cache (1)
- javascript check image is in cache (1)
- javascript check image cache (1)
- javascript check if image is in cache (1)
- javascript cachen (1)
- javascript image caching jquery (1)
- javascript image object application cache (1)
- javascript image object cache (1)
- javascript image object cached (1)
- js check image cached (1)
- javascript image object title (1)
- js how to caching an image (1)
- js image object new src no-cache (1)
You will also be interested in ,
- Tag cloud using php, mysql and ajax with filter
- Get Method and Array Manipulation In Symfony
- MD5 Function and Unique ID in php
- Url rewriting examples using .htaccess
- C sharp INTERVIEW QUESTIONS
- Displaying or changing images each day
- Display Tags in wordpress
- To Remove An Empty Element From An Array Using PHP
- How to install XAMPP
- JAVA Simple Tutorial Part-I

