I have folder in which there are no. of html files. Can i count the no. of files using javascript? Please help
Thanks
No, this is not possible using JavaScript only.
You can make an Ajax call to a page and from the server side code you can find the number of files in a folder and then return the result to the callback function.
I assume the files are in not in the client machine.
Javascript is a client side language. This means that it has no interaction at all with the server. It get sends unprocessed by the server to the client and the client executes it.
However, what you could do is learn AJAX - if you don't know it yet - and create a script (PHP, ASP, Perl, SSI, etc.) that counts the files in the directory and prints the number - I recommend Perl - .
Each minute, for example, the AJAX page would fetch the response of the script and display it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With