469,270 Members | 1,123 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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,
Mar 21 '08 #1
1 2073
16,027 Expert Mod 8TB
You can use location.hash to manage the history, e.g. see this link.
Mar 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.