posted 17 years ago
hello! i hope you can help me with this:
i am getting confused with the concept of preloading images and caching.you see, i'm building a site which is like google images where in all images in the database are shown in thumbnails within a page.now, i am looking for ways to make the loading of these images faster since the number of the images are getting bigger. when i searched thru the net, i was advised to use preloading of images via javascript which says that i am saving these images within the cache of my local machine. what confuses me though is that even if i don't have this preloading javascript code in my application, firefox and IE still saves my images in their cache automatically. so why do i still have to preload? and why are my images loading slowly even though the images are already in the cache... help! please! thanks. by the way, here are some snippets of my codes:
this is how i show the thumbnails of the image (i just resize, is this adviseable, or is there any other way?):
<td> <img src = "<%=x.getImagePath() %>" height="100" width="100" name = "img" id="img" />
this is the code i got for preloading:
var myPic = new Image(100,100);
myPic.src = "<%= x.getImagePath() %>"
is this correct? thanks! any help would be greatly appreciated.