Closed Thread
Results 1 to 6 of 6

Thread: Counting Files with JavaScript

  1. #1
    Matt's Avatar
    Matt is offline Learning Programmer
    Join Date
    Jan 2007
    Location
    Northwestern US
    Posts
    47
    Rep Power
    19

    Counting Files with JavaScript

    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.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest
    I know that javascript is client-side so it can not check server-side files. You need to use AJAX (javascript and php) together.

  4. #3
    Matt's Avatar
    Matt is offline Learning Programmer
    Join Date
    Jan 2007
    Location
    Northwestern US
    Posts
    47
    Rep Power
    19
    Ahah, thanks for the tip. Now I have something else to learn, woot!

  5. #4
    hoser2001's Avatar
    hoser2001 is offline Programmer
    Join Date
    Jul 2006
    Posts
    175
    Rep Power
    0
    if you find any good AJAX resources on the web post some links here if you would please.

  6. #5
    Jordan Guest
    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.

  7. #6
    Matt's Avatar
    Matt is offline Learning Programmer
    Join Date
    Jan 2007
    Location
    Northwestern US
    Posts
    47
    Rep Power
    19
    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.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. counting and storing
    By pindo in forum Java Help
    Replies: 6
    Last Post: 05-03-2011, 10:02 PM
  2. Array counting help
    By AtomSai in forum C and C++
    Replies: 3
    Last Post: 11-12-2010, 10:47 PM
  3. C++ Counting Help....????
    By jdjd_2009 in forum C and C++
    Replies: 1
    Last Post: 10-20-2010, 07:10 PM
  4. Counting sums from text files
    By Bertan in forum C and C++
    Replies: 4
    Last Post: 10-07-2010, 10:45 AM
  5. JavaScript code needed to create installation files
    By yeki in forum JavaScript and CSS
    Replies: 5
    Last Post: 11-02-2009, 09:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts