C
C
Cyber_bober2016-11-09 14:32:28
css
Cyber_bober, 2016-11-09 14:32:28

Why does safari cache page state when navigating back?

Hi all. Here such a thing turned out, when we leave the page, the animation hides the content on it before the transition occurs. So, if you press back in safari (any), it will return to the last state, that is, we will see a page with hidden content. How can you tell Safari to update the DOM state?
Thanks
UPD. Suddenly I found a way to fix, here is the code without details

window.onpageshow = function(event) {
    if (event.persisted) {
        window.location.reload() 
    }
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question