I've a folder on my website where I upload image files. I'd like to have all the images load up on a single webpage so they can be viewed easily, but I don't wanna have to update that page every time I add an image to the folder. So I was thinking I could use some simple javascript to load the names of all the images to an array and then just use a for loop to print them on the screen with a line like this:
I don't know much about javascript so could someone please tell me how I could go about loading the image names into an array? I've done a little searching but was unable to find something that could help me. Thanks for any help you can give me.
Question
RedawgTS
I've a folder on my website where I upload image files. I'd like to have all the images load up on a single webpage so they can be viewed easily, but I don't wanna have to update that page every time I add an image to the folder. So I was thinking I could use some simple javascript to load the names of all the images to an array and then just use a for loop to print them on the screen with a line like this:
document.write ("<IMG SRC='" + imgname_array + "' ALT=" + imgname_array + " BORDER=0>");
I don't know much about javascript so could someone please tell me how I could go about loading the image names into an array? I've done a little searching but was unable to find something that could help me. Thanks for any help you can give me.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts