Is it possible to iterate through a collection of files in Javascript? I am writing a jQuery plugin that takes either an array of images or, I was hoping, a directory containing a list of images. E.g. either:
['image1.jpg','image2.jpg','image3.jpg']
or 'http://somedomain.com/images/'
I would then like to be able to iterate through the above domain and take the file name from each of the files in the folder.
I have read about the FileSystemObject but this will only be available in IE, is there an equivalent that can be used in all browsers?
You should use server side language to provide array of images in JSON or similar. There is no way Javascript can access local files. That would be serious security issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With