Javascript to list files

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

    Expert Comment

    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

    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

    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

    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

    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

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    In Part 1 ( we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
    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…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now