I'm struggling finding a way to detect if user used BACK button to get to my website either with JavaScript or jQuery.
How can I detect that activity?
I'm struggling finding a way to detect if user used BACK button to get to my website either with JavaScript or jQuery.
How can I detect that activity?
HTML5 History data. "A popstate event is dispatched to the window every time the active history entry changes." Then do a JavaScript check on their past history to see if it matches one of your pages, or to see if this is the first page they've visited used, check history.length = 1. https://developer.mozilla.org/en-US/docs/Web/API/History_API
Store a cookie that shows they were on that page previously. If you're needing to tell if it is not the users first time visiting a page.
Have hidden form data that posts, but the user may be asked to resubmit it when going back to the page (wouldn't recommend).
I don't believe there is a way to access a users browser history outside of your website's scope for security reasons.