Alex Rivera | Logout

How do I handle user arrival-at-page via browser-back-button?

Asked 2011-08-11T15:30:57.510
9
  1. User Visits Page A and clicks around a few times, adjusting page-state as he/she goes.
  2. Page A eventually redirects user to Page B
  3. User clicks browser back button, sees Page A again in browser

I need to perform some interface clean-up on step 3.

How do I capture this event in Page A?

Edit
Report

1 Answer

1

Would it be possible in your scenario to use the URL hash to navigate to page B and use AJAX and jQuery to load the new page? Therefore, the browser is not actually leaving the page. When the user navigates back, all they will do is change the URL hash back. You could then capture the hashchange event to see if the user has navigated back to page A.

answered 2011-08-11T15:51:55.373

Your Answer