Solved

Javascript To Build Treeview of Client-Side Directory and its Sub-Directories

Posted on 2008-06-18
8
543 Views
Last Modified: 2012-06-21
Hi All,

Is there any way, given a starting directory, to use Javascript to build a treeview type menu of that directory, its sub-directories and the files therein? No server-side scripting will be used - it's strictly DHTML.

Thanks,

Lou
0
Comment
Question by:ACE-ITFLA
  • 4
  • 2
8 Comments
 
LVL 4

Accepted Solution

by:
msfletch earned 500 total points
Comment Utility
There are really two parts to your question:

1) How to create a tree view?

Pretty easy, see:

http://www.treeview.net/tv/instructions.asp

2) How to read files from a user's directory structure.

You will need more than just Javascript to accomplish this. See related threads:

http://www.webmasterworld.com/javascript/3351786.htm


0
 
LVL 4

Expert Comment

by:msfletch
Comment Utility
b0lsc0tt,

I would like to be considered for the points. Even though my answer wasn't exactly how to do it (impossible with multi-browser supported Javascript only), it was quick and correct on each point. Some times "It can't be done." is a correct answer.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
msfletch,
Thanks for your response and contribution here and to EE.  I appreciate it and did consider your comment for points.  I have reread it now and my problem is with the second part.  It isn't clear.  The part you typed doesn't clearly say it can't be done.  The forum comments you linked to aren't a clear, specific answer to this and also don't seem to have a clear conclusion.  Because IE was used as a tag and the Asker didn't make it clear whether this was an Internet page or not there is the chance it actually can be done.  The solution would be IE only and not work for a page on the Internet trying to read local files but it could be an answer in this case based on the little info you were provided by the Asker.
If you are interested in I will be glad to explain my thoughts more and even provide a suggestion or two.  The real unfortunate thing here is the Asker never responded which probably would've provided you a chance to get more details and provide a clear and complete answer for the second part.  As an expert here I know what it is like to be in your shoes.
Let me know if you have a question about this reply or are interested in anymore from me.  I hope this explanation helps you know why I recommended what I did.  Remember a third party will actually close this so your objection and any response you post will be read by them.  They don't always go with the CV's recommendation when there is an objection.  No matter what happens here thanks for your contribution and efforts.  I know EE appreciates them. :)
b0lsc0tt
EE Cleanup Volunteer
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 4

Expert Comment

by:msfletch
Comment Utility
Point well taken. The asker did not say that other browsers needed to be supported. As you said, it would have been nice to have had some response to my answer so I could clarify. =)
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
msfletch,
I am glad you assumed the answer needed to be supported by all browsers though.  Keep doing that.  Some experts will post a "solution" that is browser specific and not mention that very important limitation.  It is also easy to overlook what is in the tags, I have done it before too.  Like you said, a response would've made a big difference but I wanted to make sure you didn't misread some of what I said and stop doing the good things you did here.  It really was a good start and I won't be upset if the Mod/Admin who closes this decides against my recommendation.  I hope we continue to see you around and good luck. :)
b0lsc0tt
EE Cleanup Volunteer
0
 
LVL 4

Expert Comment

by:msfletch
Comment Utility
Thanks B0lsc0tt!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now