I'm trying to display ~500 files in 50 subfolders on one HTML page on my laptop. Files change often enough it's no use if it's not dynamic.
Below is from my main.js. It all works. Local links and all but how can I get a list of files from my laptop through my browser? I figured I could with javascript but no luck yet.
// where are we?
var loc = window.location.pathname;
var dir = loc.substring(0, loc.lastIndexOf('/'));
document.write(loc + '<br>');
document.write(dir);
// make links from a list passed to it
function MakeLinks2(files) {
var text = "";
var i;
text += '</ul>';
for (i = 0; i < files.length; i++) {
text += '<li><a href="pdfs/' + files[i] + '">' + files[i] + '</a></li>';
}
text += '</ul>';
document.getElementById("external").innerHTML = text;
}
window.onload = MakeLinks2(["1.pdf", "2.pdf", "3.pdf", "4.pdf", "1.pdf", "2.pdf", "3.pdf", "40.pdf"]);