Javascript/Ajax Disable or manage the browser back button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CpVermont
    New Member
    • Feb 2008
    • 14

    Javascript/Ajax Disable or manage the browser back button

    Good Morning,

    I am working on a page that uses ajax to display a list of products after a search. The content is displayed in 10 divs created in the DOM. If the search returns more than 10 results. I put the next 10 products into the same DIVS. In other words the user never leaves the page. The problem arises when they use the back button to look at the previous 10 products it takes them clean off the page. In a perfect world we would retrain everyone to leave the back button alone, but that is impossible. I need some suggestions on how to manage the back button. I thought about using cookies, but not everyone enables them. Any suggestions will be much appreciated!

    Have a great day,
    CpVermont
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can use location.hash to manage the history, e.g. see this link.

    Comment

    Working...