A pure newbie in javascript :)

What I need is a **function** to get all the file names in a directory(lets call it results) which is in the same place with my html file. 

The function could return array that holds file names or the result could be stored in a global variable.

Regards!

**Edit** Thanks everyone for the answers and information. I really did not know that I had to use a client side language :)