pageshow/pagehide events not firing
Asked Answered
I

1

4

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?

Interpreter answered 4/5, 2015 at 14:3 Comment(3)
I think they are jQuery Mobile events. Hope you are using those with jQuery Mobile ?Eblis
Try .onload and .onunloadLuedtke
No, I don't use jQuery Mobile. pageshow is part of the standard, but I'm not sure about pagehide, I am not able to trigger it.Interpreter
R
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);
Rubric answered 4/5, 2015 at 14:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.