Is there any way to know if the loaded page comes from a back button call?
This is the path:
- index.html (link to page1 in the menu)
- page1.html (loads content from ajax with link of page2)
- page2.html (press BACK button)
- page1.html (DETECTS BACK BUTTON PRESSED FROM PAGE2, THEN DO SOMETHING)
Page 2 can be loaded from pageX so it is not an option to use onbeforeunload
or something like that to handle back/forward button in page2 to redirect to page1, page2's back button can redirect to pageX instead of page1.
I need to put the code in page1
Is it possible?