How we can detect the browser back button click (for any type of browsers)?
My Browser Url : http://project_name/razorpay/pay.php?checkout=manual&invoice=80
I try below code in pay.php page but not getting any alert or console data :
1.
window.onhashchange = function() {
console.log('call');
}
2.
$(window).on('popstate', function (e) {
var state = e.originalEvent.state;
if (state !== null) {
console.log('call');
}
});