Some time ago, I created this code to display random events on my website. While the code functions well, I now wish to incorporate a timer.
I envision that when a user refreshes or enters the page, they will be redirected initially and then redirected again to the same page every X seconds.
<script>
var test = Math.floor(Math.random() * 1) <= 1;
if (test) {
window.location = "URL";
}
</script>