Prevent safari loading the last page as the same when leave when navigating back

when press back button, safari will navigate to the page that is same as when we leave, we don’t want that, use this code!

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

from : https://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked


已发布

分类

,

来自

标签:

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注