Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get a list of all folders in directory [closed]

So I have a file system that looks like this:

Music
- 001
-- song.mp3
- 002
-- song.mp3
- 003
- 004
- 005
-- song.mp3
musicplayer.html
musicplayer.js

I was curious if it is possible to get a list of all of the folders names?

This javascript, html5, or even jQuery, I can not install anything.

like image 742
Robert E. McIntosh Avatar asked Mar 21 '13 00:03

Robert E. McIntosh


1 Answers

he has a point in his question (HTML5)


I was curious if it is possible to get a list about all of the folders names? This javascript, or even jQuery, I can not install anything

Simply No , but not the Last Answer !

JavaScript (JS) is an interpreted computer programming language.It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed.

There are 3 major types of JavaScript namely:

Client-Side JavaScript (CSJS) -- an extended version of JavaScript that enables the enhancement and manipulation of web pages and client browsers

Server-Side JavaScript (SSJS) -- an extended version of JavaScript that enables back-end access to databases, file systems, and servers

Core JavaScript -- the base JavaScript language

Client-Side JavaScript (CSJS) and Server-Side JavaScript (SSJS) are dependent on the core JavaScript and cannot work without it.

JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the web. Browser authors contain this risk using two restrictions. First, scripts run in a sandbox in which they can only perform web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one web site do not have access to information such as usernames, passwords, or cookies sent to another site. Most JavaScript-related security bugs are breaches of either the same origin policy or the sandbox.

There are subsets of general JavaScript — ADsafe, Secure ECMA Script (SES) — that provide greater level of security, especially on code created by third parties (such as advertisements).

I was curious if it is possible to get a list about all of the folders names? with HTML5

HTML5 provides FileSystem API which may solve your thirst , at least for know :)
Read the tutorial here : http://www.html5rocks.com/en/tutorials/file/filesystem/


another solution is to use the ugly browser Api, that i never ever recommends
Best Solution is to use a server side language like php

like image 200
internals-in Avatar answered Oct 10 '22 02:10

internals-in