0

I came across a requirement of performing some button click action when a user clicks on browser back button,

I tried using window.onpopstate(), but the issue here is, it is triggering when the page loads, when user clicks on browser back and when user clicks on browser forward...

I want to catch the exact event only when the user clicks on Browser Back button... My intention of solving this issue is:

inside the browser back event I would like to find a back button and make a click function which would achieve my task.. as below:

$('input[name="back"]').click();

So my problem here is to detect the Browser back button event.

Meena
  • 685
  • 8
  • 31
  • Does this answer your question? [How to Detect Browser Back Button event - Cross Browser](https://stackoverflow.com/questions/25806608/how-to-detect-browser-back-button-event-cross-browser) – Philip F. Apr 14 '20 at 10:38
  • Does this answer your question? https://stackoverflow.com/questions/25806608/how-to-detect-browser-back-button-event-cross-browser – Philip F. Apr 14 '20 at 10:39
  • I have gone through the above solutions none of them are working – Meena Apr 14 '20 at 11:56

0 Answers0