We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Javascript to list files

neelyjer asked
Medium Priority
Last Modified: 2012-08-14
Hello Experts.

I am still quite new to javascript, but I'd like to create a list of files within the images folder of my website using javascript.  I am hoping to perform this action on the client's end.  Later I will load this to an array, but for now I'd just like to retrieve a list of file names.  is this possible?

Thanks in advance!

Watch Question

Javascript is executed on the clients host so you cant get the file list from your server. You need to use a server side sripting language such as PHP for this purpose.
Only you can use javascript to list out files if you use AJAX.  But at the same time you have to provide a server side script for your javascript to get the listings.

more about ajax

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thanks Experts, your responses are appreciated.  I am still new to this kind of coding.  Can you provide a simplified example to get me started?  I'm not looking for you to write the whole thing for me as I would like to learn.  I learn best by doing, I just don't know where to start.

Thanks Experts!
read the tutorial in my last response for learning ajax
for the server script part(listing the files bit), i recommend you to use php for this.
Try to check these search results to find some examples


Sorry for the delay in my response Experts.  I've been quite busy lately, but I'll take a look at the last suggestion and get back to you all asap.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.