pageshow event

by yakun chen

HTML

<!-- 
  The following will log info about the pageshow event, 
  which is fired on back/forward, not just after onload: 
-->

类似 resume 事件,在页面前进后退时使用, 不仅限于在 onload 之后。

JavaScript

window.addEventListener('pageshow', function(event) {
    console.log('pageshow:')
    //console.log(event) 
})

document.addEventListener("DOMContentLoaded", function(event) {
  console.log("DOM fully loaded and parsed");
});