How to find all files in directory? I have HTML page in some directory. Using JavaScript I want to get all existing files in some subdirectory ( get all file names or relative links to them, on a local machine)
Unless you have your server setup/defaulted so that you can go to a index-less directory and be presented with a list of files and directories that reside in that directory then that information isn't public.
You might want to try writing a short server-side script to retrieve a list of the files in your directory and make an AJAX call to it?
Javascript which runs at the client machine can't access the local disk file system due to security restrictions. Otherwise one would be able to upload files in a hidden form unaskingly using Javascript.
If you like to access the client's disk file system, then look for the solution in a different corner: an embedded client application which you serve up from your webpage, like an Applet, Webstart, Silverlight or something like that. If you like to access the server's disk file system, then look for the solution in the server side corner using the server side programming language like Java, PHP, etc, whatever your webserver is currently using/supporting.