I am having a requirement that when a user makes his payment and reached on success page and go back it should be redirected to a custom page. So if i will click on browser back button it will show me two options - Leave Page and Stay on this page. When i will click on Leave page it should redirect to my custom page. I found following link useful but not working for 'Leave Page' button....kindly suggest or help.
using onbeforeunload event, url change on selecting stay on this page