微信网页页面回退不刷新

方法一:

$(function () { 
  var isPageHide = false; 
  window.addEventListener('pageshow', function () { 
    if (isPageHide) { 
      window.location.reload(); 
    } 
  }); 
  window.addEventListener('pagehide', function () { 
    isPageHide = true; 
  }); 
})

 

方法二:

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

posted on 2017-08-17 09:42  junsky  阅读(2188)  评论(1)    收藏  举报

导航