Refresh via javascript

This commit is contained in:
Michael Mandl 2018-11-10 20:32:06 +01:00
parent 07fd3bdce5
commit 30ee37bf74

View file

@ -1,6 +1,5 @@
<html> <html>
<head> <head>
<meta http-equiv="refresh" content="{{ refresh }};url={{ url_for("random") }}" />
<style> <style>
img { img {
width: 100%; width: 100%;
@ -19,7 +18,13 @@
document.getElementById("slider").src = this.src; document.getElementById("slider").src = this.src;
}; };
downloadingImage.src = "{{ url_for("random_image") }}"; function updateImage()
{
downloadingImage.src = "{{ url_for("random_image") }}?" + new Date().getTime();
}
updateImage();
setInterval(updateImage, {{ refresh * 1000 }});
</script> </script>
</body> </body>
</html> </html>