|
Project Information
Members
Links
|
indexes.js is pure(?) Javascript filelist library. - Get the list of files and directories "as Array" or "with Callback". No need serverside scripts, but require Apache "mod_autoindex" module (and "jQuery" or "Prototype"). UsageTarget Directorytarget/ - dir1/ - dir2/ - file1.txt - file2.html Setting (Apache)target/.htaccessOptions +Indexes or httpd.conf<Directory /path/to/target/> Options +Indexes </Directory> Examplewith jQuery (Callback)<script type="text/javascript" src="http://indexes.googlecode.com/svn/trunk/indexes.js"></script>
<script type="text/javascript">
$(funtion() {
var indexes = new Indexes();
indexes.index('target', function(a) {
alert(decodeURIComponent(a.join('\n')));
});
});
</script>with Prototype (get Array)<script type="text/javascript" src="http://indexes.googlecode.com/svn/trunk/indexes.js"></script>
<script type="text/javascript">
document.observe('dom:loaded', function() {
var indexes = new Indexes();
var a = indexes.index('target');
alert(decodeURIComponent(a.join('\n')));
});
</script>Resultdir1/ dir2/ file1.txt file2.html DemoTest site is here. Lisence |