Can anyone help me and provide a way to list files in a directory using javascript. This is on the server (NOT CLIENT). For our purposes we have built a simple search facility (that all we need) and the code takes data from an array. All we want to do is traverse the HTML files, open each one and take out the key words to put into an array.

I have searched google to no avail. Some articles say this can be done but don't provide examples and some articles say it cannot be done. A cross browser simple example would be nice.

Help appreciated in advance

Nope, you have to use a server-side language. Javascript lives in the browser so it can't directly touch either your server or your client's machine. You can have Javascript make a request to the server which provides a listing but Javascript itself can't.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.