Решение для события onpopstate, которое не работает в Chrome, но отлично работает в IE и FireFox. ⇐ Jquery
-
Anonymous
Решение для события onpopstate, которое не работает в Chrome, но отлично работает в IE и FireFox.
When a user press the browser back button I want to alert the user, for that to capture the browser back button event I am using onpopstate event as show below. But the problem is the event is working fine in IE and FireFox but it is not being triggered in chrome. Kindly help me with this, Thanks.
$(window).on('popstate', function () { this.alert("Do you really want to leave the page?"); }); Using Chrome 75
Источник: https://stackoverflow.com/questions/569 ... orking-fin
When a user press the browser back button I want to alert the user, for that to capture the browser back button event I am using onpopstate event as show below. But the problem is the event is working fine in IE and FireFox but it is not being triggered in chrome. Kindly help me with this, Thanks.
$(window).on('popstate', function () { this.alert("Do you really want to leave the page?"); }); Using Chrome 75
Источник: https://stackoverflow.com/questions/569 ... orking-fin
Мобильная версия