Page Auto Refresh

I was wondering if there was a way to refresh a certain page after a set amount of seconds?

Thanks

Yes:

import wixLocation from 'wix-location';
$w.onReady(function () {
setTimeout(() => wixLocation.to(wixLocation.url), 5000)//TIME IN MILLISECONDS
})

Thank you so much!

Where do you add this? I added it to the page code but it does not work.

It should work on the page code panel.
but only on the published site, not in preview mode.

Is there a code I can add that auto refreshes the page every few seconds?

I Tried the html block code that says it auto refreshes but it just re directs

The code above does it.


This is what I plugged in but it is still not working. For the https I plugged in my site.

So delete your code and put the code I put in the beginning of this thread

Working now, thanks!

You’re welcome.

Ciao,
volevamo sapere se c’era un codice per aggiornare la pagina solamente una volta dopo che la pagina è stata caricata?

import wixLocation from ‘wix-location’;
$w.onReady(function () {
setTimeout(() => wixLocation.to(wixLocation.url), 5000)//TIME IN MILLISECONDS
})

Questa funzione refresha la pagina ogni 5 secondi, a noi servirebbe una volta sola.
Grazie del supporto!

Is it possible to change the background colour of a strip based on an external variable? For example, when the page is loaded then it receives a variable from a central database and that dictates the colour of the strip?