Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2008-06-18
8
546 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
ID: 21817812
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
ID: 22499083
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
ID: 22503670
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Expert Comment

by:msfletch
ID: 22503754
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
ID: 22504110
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
ID: 22504339
Thanks B0lsc0tt!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript/JQuery - HtmlEncode (?) Ajax Result 1 65
Writing comments on <p></P> or paragraph 2 19
how can i get the string decoded ? 2 28
jQuery Dialog Autoresize Bug 2 24
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

809 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