So I am doing a live video stream and when the video is over, I want to be able to to refresh the users page and send them to a thank you page. I tried doing it this way:
var delayInMilliseconds = 5000; //1 second
setTimeout(function() {
location.reload();
}, delayInMilliseconds);
Then when we are ready to switch I just upload a new page but with:
window.location.replace('example.com');
However I don't want the page to refresh all the time as it keeps restarting the video. Is there a way to check for a new page every few seconds but not actually refresh the page? or is there a better and easy method I should be doing instead?