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>
|
<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>
|
||||||
|
|
Loading…
Reference in a new issue