I am having a requirement where i want to catch browser back button event and show them feedback message and also dont allow them to navigate.
Some of the solutions i got are this:-
1.
window.history.pushState(null, "", window.location.href);
window.onpopstate = function () {
};
2.
history.pushState(null, null, location.href);
history.go(1);
But my application is little different.
I am having 3 web blocks in same page which i am displaying as per visibility control.
This solutions are directly refreshing my page, i dont want that.
Please help me out with this!
Hi Krunal,You can try use this.https://stackoverflow.com/questions/25806608/how-to-detect-browser-back-button-event-cross-browserRegards.
Hi Kunal,
I have implemented it in vanilla JS. I am attaching the JS code snippet image. You can go through it for the reference.
Thanks,
Mayur