Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (27 sloc) 1.3 KB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jQuery Image Cache</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="assets/jquery-1.5.min.js"></script>
<script type="text/javascript" src="assets/jquery.imageCache.js"></script>
</head>
<body>
<h1>jQuery Image Cache plugin</h1>
<p>Images are kept in browser's Local Storage! But, sometimes they do a request to the server to check if the image is not updated when you keep the SRC attribute.</p>
<ul>
<li><img src="assets/test-image-1.jpg" class="imageCache" /></li>
<li><img src="assets/test-image-2.jpg" class="imageCache" /></li>
</ul>
<p>Images are kept in browser's Local Storage! No requests to the server are done because the image URL is not stored in the SRC attribute anymore but in data-src.</p>
<ul>
<li><img src="" data-src="assets/test-image-4.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
</ul>
<script type="text/javascript">
$('img.imageCache').imageCache();
</script>
</body>
</html>