While I don't know the specifics, if I were to approach this problem with no previous knowledge, I would look into retrieving a directory listing via AJAX, then parsing it to determine the contents, then run a loop to load each file.
The directory listing format and availability would be dependent on the web server software where the files are located.