title: How do I count files in a directory using jQuery?
body: <p>I'd like to count the number of files in a folder and return that number to set a variable in a .js file.</p>
  
  <p>Essentially, I have X number of images in a folder. When the user clicks the right arrow, I replace the existing set of 8 images with the next set of 8 images, and so on and so forth. I currently manually enter the variable (38 right now) into the page, since there are 38 thumbnails in the folder.</p>
  
  <p>The code works perfectly, but I hate the idea of changing a number each time I add a file. I'd like to have it set the variable to the exact number of images in the folder.</p>
  
  <p>Is this possible using JavaScript or jQuery? Do I need to write a PHP file to do return this variable for me? Any information would be great!</p>