What I have:
A .html on a computer in my local network at work, without a web server. The index.html is therefore accessed through file:// and not http://.
What I want:
A .html that shows the most recent image in a folder and automatically refreshes. I have a program taking screenshots every X seconds and saving them as "NameHHMMSS.jpg".
Is this possible without Web Server, PHP installations and so on? Thank you in advance!
2
Answers
You can create a function to dynamically generate the filename and load the image. Then you can use
setTimeout
to call the function from within itself at a desired interval.Here is a quick test (Notice the image name changes every 5 seconds):
If it is just an .html file, you can put the code below inside the
<head>
tag for the page to refresh every 5 seconds.Just edit the code above based on your requirement.