I had exactly the same problem; The @Alfabravo link helped me a lot: stack overflow
The code below worked well for me, since I really needed to do some cleanup either when the user entered the page, or when the page was reached using the back button:
$(window).on('pageshow', function(){ console.info('Entered the page!'); });
If you need to specifically determine when the page was reached using the "Back" button, but not the first time you enter it, you may need to control a bit of state; link can help you.
Haroldo_ok
source share