[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Javascript to list files

Posted on 2009-02-13
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!

Question by:neelyjer
  • 2
  • 2

Expert Comment

ID: 23638127
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.
LVL 15

Accepted Solution

quincydude earned 2000 total points
ID: 23656057
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

Author Comment

ID: 23690172
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!
LVL 15

Expert Comment

ID: 23708403
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

Author Comment

ID: 24454959
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.


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question