Javascript – Reload the page if recovered from cache

window.onpageshow = function(evt) {    
    if (evt.persisted) {
        document.body.style.display = "none";
        location.reload();
    }
};

Leave a Comment

Your email address will not be published. Required fields are marked *