Home >
Article > Web Front-end > Two solutions for Javascript folder selection box_javascript skills
Two solutions for Javascript folder selection box_javascript skills
WBOYOriginal
2016-05-16 18:50:561019browse
Solution 1: Call the windows shell, but there will be security issues.
* browseFolder.js * This file defines the BrowseFolder() function, which will provide A folder selection dialog box * for users to implement the function of selecting system folders * The starting directory of the folder selection dialog box is determined by * Shell.BrowseForFolder(WINDOW_HANDLE, Message, OPTIONS, strPath) strPath parameter setting of function * * For example: 0x11--My computer * 0 --Desktop * "c:\"--System C drive * * Use the following code to apply this function to an HTML file: * * Or copy the following code directly to tag;
* Special note is that due to security issues, you also need the following settings to make this JS code run correctly , * Otherwise, the problem of "no permissions" will occur. * * 1. Set up a trusted site (for example, the local one can be: http://localhost) * 2. Secondly: In the custom settings of trusted site security level: set the following options * "Initialize and script run ActiveX controls not marked as safe"----"Enable"
2. Solution 2: Write one yourself js reads the selection box of the local hard disk. The disadvantage is that the appearance is worse than the previous one.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn