scan files in a directory using ajax/javascript
Im a beginner of javascript and ajax. and i would like to use ajax to popul开发者_开发技巧ate my tag with which are the content of a particular directory.
is there such opendir() fxn in ajax just like in php? Where do i start from here?
Since you use ajax to access PHP, you can start with a simple ajax request and return the scandir
results.
A quick guide for beginners can be found in this question, which should start you on your way.
No, there is no way to list files in either a server or client directory. You can make a server wrapper script for this, but it may be better to approach it at a higher level (e.g. return a list of resources, while not exposing the implementation of a resource).
精彩评论