views:

296

answers:

1

hi

I have no.of page, which will the children relation ship. once i in 5th page, i need to go 4th page, that mean what i browser before, for that i used

window.history.back(),

but the page is just refreshing, not going back. what the way i can achieve this? that mean what is the best way to create widow back button with all browser supportable?

+3  A: 

You're doing it wrong. The browser already has a button to go back in the history and you don't need to re-implement it. What if I get to page 5 through Google, how am I supposed to get back? Your back button would take me back to Google.

Instead, create a normal link to the URL of the hierarchially previous page. Preferably on the server side.

Matti Virkkunen
no, this is not like this. i need just my button need to take me back, that's enough. even i used "history.go(-1)", but page is refreshing going back and loading the lat page again.. any suggestion?
3gwebtrain
3gwebtrain: But the browser *already has that button*. Why would you want to confuse your users by having two buttons for the same thing?
Matti Virkkunen
You cannot go call the browser's back button call. As you said history.go(-1) would reload the page, it will not fetch it from cache (if that is want to you want. To keep it short, you cannot emulate the browser's BACK button.
Sairam Kunala