I have been searching all day trying to find a way to count the number of files in a server-side directory using JavaScript. I thought that, even though JavaScript is run locally, it would still have the capability of doing this kind of thing. Maybe not. I just thought I would check here to make sure. If you know how to do this, please let me know. Thanks.
Also, in a similar vein, is it possible to check the existence of an online file (not on the user's computer) using JavaScript? This is another thing I failed to figure out. Any ideas greatly appreciated.
I know that javascript is client-side so it can not check server-side files. You need to use AJAX (javascript and php) together.
Ahah, thanks for the tip. Now I have something else to learn, woot!
if you find any good AJAX resources on the web post some links here if you would please.
It wouldn't be hard to count files on a server and have the output in JavaScript. If you haven't found the solution yet and if you tell me the output I can create a quick AJAX script for you.
Thanks for the offer; I appreciate it. I have recently settled for just changing a variable in my JavaScript every time I add files to the directory in question, feasible for the amount I plan to do it (not much). Learning AJAX sounds like it would be beneficial though, so I might be back here for help with that later.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks