Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying last 6 images

Status
Not open for further replies.

awolff02

Programmer
Nov 24, 2008
6
US
I've searched the forum and was not able to find any hints to get me started. Basically I have a folder that images get uploaded to every x minutes. The images are titled:

IMAGE1YYYYMMDDHHmmss

So I want to be able to read all the image files into an array..sort the array so that the latest 6 images reside in index 0-5. Then display those 6 images. Is this doable with javascript?

I am thinking it's not since javascript is client side. Any help is appreciated.
 
You should be able to do this no problem, even client-side, as the image object supports 2 events, 'onload' and 'onerror'.

You should be able to use these to determine fairly reliably whether an image exists or not without the need for server-side scripting or ActiveX controls, etc.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top