0

I want to call onpageshow event on my web page. It working fine when I a page show in browser and also when I come back to a page using browser back button. But when I run the same thing is not calling for my windows phone browser in case of page show using browser back button. By typing page url in address bar and hit enter is working fine.

Below is my code snippet.

var myEvent = window.attachEvent || window.addEventListener;
var chkevent = window.attachEvent ? 'pageshow' : 'pageshow';

myEvent(chkevent, function (e) {
    alert('leave'); 
});

Please suggest. Thanks in advance.

Deepak Arora
  • 440
  • 2
  • 11
  • See the non-jQuery answer Posted in [this SO](http://stackoverflow.com/a/12648745/3154111) a couple years ago. – Rando Hinn Dec 04 '15 at 07:52
  • The problem is pageshow is calling on desktop browser when page show by back button but not calling in mobile phone browser by back button. I have also tried this but not working. – Deepak Arora Dec 04 '15 at 08:23

0 Answers0