1

Im a beginner of javascript and ajax. and i would like to use ajax to populate 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?

2
  • Do you want to scan directories on the visitors computer, or your server? The first won't be possible due to the nature of Javascript which does not provide any Filesystem functions. The second would require a serverside script. Commented Nov 11, 2010 at 7:55
  • on my server.. what do you mean by a server side script? i am running the page on the server itself sir. Commented Nov 11, 2010 at 8:07

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.