I am using the refresh command to refresh the database on the page so that it displays a particular image depending on what hour it is from my dataset.
However, it only changes when the page is refreshed so though it will display correct image for a visitor arriving, it will not change whilst that visitor is actually on the page without refreshing.
I do NOT want it to refresh the whole page as we have a live player on there that will also refresh and interrupt the stream. I ONLY want the image to change - some way of having the code re-run itself every ten minutes or so on a loop so that the new image is then displayed on the visitor's end.
Is this possible? It seems that we can only refresh the whole page, not just a display element.
Many thanks to those offering answers.
Sorry but can't see how Realtime can help me. Like I said, I am very green and need examples to learn (leech) from
setInterval function will perform an action continuously every "X" milliseconds.
10min = 600000millisec
setInterval(() => { $w("#image").src = "image-link"; }, 600000);
Post your code please