-1

I want to show the most recent image from a folder (Windows) and have the page (.html) automatically refresh, say, every 5 seconds. What's the easiest way to do this? I prefer not to install any software for this and do it in (for example) the browser.

Jos
  • 59
  • 1
  • 8
  • Which part are you stuck on? – nnnnnn Nov 21 '14 at 12:02
  • 1
    You wouldn't. The browser JS doesn't have direct access to the local filesystem. You need something else that feeds the file information to the browser. – JJJ Nov 21 '14 at 12:04
  • Could you clarify if this needs to be a web-based solution or something that could run interactively on the same machine. – Sam Greenhalgh Nov 22 '14 at 14:43

1 Answers1

1

It is not possible to get the creation date of an image using only JS.
You need to either try an AJAX solution, or use a specific name for the last saved file
(f.e: "lastimg.png")


For the 5second refresh mechanism You can use setInterval.
Using this solution, this topic might also be useful for You.

For a more specific answer, try to ask a more specific question.
Community
  • 1
  • 1
István Pálinkás
  • 2,217
  • 7
  • 25
  • 50
  • I agree that the question was lacking information. The thing is, I wasn't actually sure whether Javascript was the best way to go. Obviously it's not. I just have a simple task to do, showing the most recent image on a screen, but I'm not sure what the easiest way to do this is. – Jos Nov 21 '14 at 12:44