Refresh via javascript
This commit is contained in:
parent
07fd3bdce5
commit
30ee37bf74
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="{{ refresh }};url={{ url_for("random") }}" />
|
||||
<style>
|
||||
img {
|
||||
width: 100%;
|
||||
|
@ -19,7 +18,13 @@
|
|||
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>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue