3

I came across pageshow/pagehide events, but I'm not really sure how they work.

I registered them on document, and later on window object, but they never fired.

I expected them to fire after the page is loaded for pageshow, and when I go to some other page for pagehide, but this never happened.

Where can I find more information about these events?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Zed
  • 5,683
  • 11
  • 49
  • 81

1 Answers1

1

Your question was quite vague but I think that you can learn a little using this post http://aawaara.com/post/74543339755/smallest-piece-of-code-thats-going-to-change-the

They use them like this, but it seems as the way you are using them

window.addEventListener("pageshow", function(evt){
        clearTimeout(timer);
    }, false);

    window.addEventListener("pagehide", function(evt){
        clearTimeout(timer);
    }, false);
Lucas Sodré
  • 77
  • 11