I have this code to randomly grab a file from a folder path, and load it via jQuery:
var path = '/path-to-files/',
files = ['1.php', '2.php', '3.php', '4.php', '5.php', '6.php'],
i = Math.floor(Math.random()*files.length);
var url = (path+files[i]);
$("#my-div").load(url);
It's great, it works well. But I would prefer a method to randomly grab files from the path without building an array. Is that possible?