Is there a way to make a dynamic link menu that feeds itself with the content of a windows folder.
So when a file is added to the folder it automaticly appears in the link menu.
Who can answer/help me?![]()
Is there a way to make a dynamic link menu that feeds itself with the content of a windows folder.
So when a file is added to the folder it automaticly appears in the link menu.
Who can answer/help me?![]()
Not in Javascript. Do you have any server-side languages?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
No, unfortunately not, its for a local intranet, running on a normal file server.
'Fraid not, then. It may be possible with some advanced AJAX and a little server manipulation, but I wouldn't want to... oh wait.
This is horribly hacky, and untested, and I'm sure you'll need to tweak it, and it all hinges on your server producing "index of" pages for directories without indices.Code:<iframe style="width:0;height:0;display:none;" id="hiddenframe">Your browser does not support iframes, so the dynamic link menu will not be available.</iframe> <script type="text/javascript"> window.onload = (function() { var menuElement = document.getElementById("menu"); // Element to populate var dir = "/downloads/"; // Directory to use. Must not have an index: it needs to send an "index of" page var junkLinksTop = 0; // "Junk" links to cut off the top of the menu. var junkLinksBottom = 0; // Same, for the bottom. document.frames['hiddenframe'].src = dir; menuElement.innerHTML = ""; var if = document.frames["hiddenframe"].document, a = if.getElementsByTagName("a"), i; for(i=junkLinksTop;i<a.length-junkLinksBottom;i++) { menuElement.innerHTML += '<a href="' + a[i].href + ">' + a[i].innerHTML + '</a>'; } }); </script>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks