获取目录中所有文件夹的列表 [英] get a list of all folders in directory

查看:169
本文介绍了获取目录中所有文件夹的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个如下所示的文件系统:

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

我很好奇是否有可能获得列表关于所有的文件夹名称?



这个javascript,html5甚至jQuery,我不能安装任何东西。

解决方案

他的问题中有一个问题: >


我很好奇是否有可能获得关于所有文件夹
名称的列表?这个JavaScript,甚至jQuery,我不能安装任何东西。


只是没有,但不是最后的答案! JavaScript(JS)是一种解释性的计算机编程语言。它最初是作为Web浏览器的一部分实现的,因此客户端脚本可以与用户进行交互,控制浏览器,异步通信以及更改显示的文档内容。

有三种主要的JavaScript类型:

 客户端JavaScript(CSJS) -  JavaScript的扩展版本,可以增强和处理网页和客户端浏览器

服务器端JavaScript(SSJS) - 支持后端访问数据库,文件系统和服务器的JavaScript扩展版本

核心JavaScript - 基本JavaScript语言

客户端JavaScript(CSJS)和服务器端JavaScript(SSJS)分别是依赖核心JavaScript,不能没有它。



JavaScript和DOM为恶意作者提供脚本以通过网络在客户端计算机上运行的潜力。浏览器作者使用两个限制包含这种风险。首先,脚本在沙箱中运行,其中只能执行与网络相关的操作, 不是通用编程任务,如创建文件 。其次,脚本受同一起源策略的约束:来自一个网站的脚本无法访问诸如用户名,密码或发送到其他站点的cookie等信息。大多数与JavaScript相关的安全漏洞都违反了相同的原始策略或沙箱。



有一般JavaScript的子集 - ADsafe,安全ECMA脚本(SES) - 提供更高级别的安全性,特别是第三方创建的代码(如广告)。


我很好奇是否有可能获得关于所有文件夹
名称的列表?与HTML5


HTML5提供了FileSystem API,可以解决您的口渴,至少知道:) >
阅读教程: http://www.html5rocks.com/ en / tutorials / file / filesystem /

另一个解决方案是使用丑陋的浏览器Api,我永远不会推荐
< br> 最佳解决方案 是使用服务器端语言,如php

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 about all of the folders names?

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

解决方案

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

这篇关于获取目录中所有文件夹的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆