S
S
sergz19822019-10-25 10:35:10
URL Handling
sergz1982, 2019-10-25 10:35:10

Is there a script so that when the page of the site is updated automatically, a transition to another page occurs?

The user came to the site page site.ru/page111 , walked around it, and when you click the Refresh button in the browser, you need to automatically go to the site.ru/page222 page at that moment. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-10-25
@dollar

if (localStorage.test == 1) location.href = "https://site.ru/page222";
window.onbeforeunload = e => location.href = localStorage.test = 1;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question