Barely said:
What about the gals, huh? You chauvinistic pig.
I was wondering if it was possible to have a js file that, when the page
loaded, it automatically generated a a set of thumbnails from directory
of the page on the web server?
Well, sure you can. However, there is a problem. I'll tell you at the
end of my post.
var imgs = ['my_mom', 'my_child', 'some other picture', 'pron'];
for (var i = 0, l = imgs.length; i < l) i++)
{
var new_img = document.createElement('img');
new_img.src = imgs
+ '.jpg'; // or you could store the extension
document.getElementsByTagName('body')[0].appendChild(new_img);
}
Or you could just loop the array and write the results to the page using
the write method or innerHTML.
Or would this create an unacceptable security hazard?
The problem is by not creating thumbnails server-side or at least with
an image resizing application, you are creating unnecessary loading
times. Not to mention the fact that you end up loading too much
information in the user's browser or other viewing device.
Think on this. If I have ten images that are each 10 megabytes, then
the user has to load 100 megabytes of information just to view
thumbnails that you resize via CSS or JavaScript.
Serve them resampled thumbnails and you eliminate this problem.