Hey I'm calling history.back() on the on-click of a 'back' button in a rails app. But nothing happens. There is history in the browser -- pressing the browser's back button takes me back to the correct page.
If I use history.go(-2) however, the page goes back correctly. So why do I have to tell javascript to go back two pages instead of one?
Any ideas how to debug this?
I tried this in FF and Safari.
Thanks!
--Additional Info:
Ok I played around some more and this works:
<a href='javascript:' onclick='history.back();'>
Originally, the code was:
<a href='#' onclick='history.back();'>
What's the difference? (Note that this used to work before, something has changed which makes the latter link not work)