📜  单击后退按钮时防止从缓存中加载 Safari - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:36.287000             🧑  作者: Mango

代码示例1
window.onpageshow = function(event) {
    if (event.persisted) {
        window.location.reload() 
    }
};
//If you are using jQuery then do:

$(window).bind("pageshow", function(event) {
    if (event.originalEvent.persisted) {
        window.location.reload() 
    }
});