Hello,
I was wondering if anyone had any javascript code that could build a dynamic list of files in a web directory.
For example, I want to build a dyanamic drop down list navigator of images I’ve placed in an image directory. The intent is so a user could select an image from the drop down list, and the chosen picture would display in an <img> tag on the current page.
I already know how to code the javascript to update the <img> when a different drop down option is chosen, but so far, the only way I know how to add new options to the drop down list when new images are added to the image directory is to add the new “options” to the .html file with the drop down select. So every time I add a new image, I have to update the .html file as well.
It would be nice if there was some code that could look in the image directory and dynamicaly add those select options so I only had to add the image into the directory without having to update the .html page as well.
So, is there any javascript code that I could use that would be functionally equivalent to
For Each file In folder.Files
// create select option
Next
Or, does anyone have any other ideas?
Thanks for the help!