• 0

Directory Listing In Javascript


Question

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

  • 0
Nevermind. I found some PHP samples and was able to put together something that works.

ok, PHP is a great language combined with Javascript, you can do some great things.

But it is always better using PHP to do file management stuff, like uploading, directory reading, etc.

Kind regards

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.