This code works fine in FF, it takes the user back to the previous page, but not in Chrome:
<a href="www.mypage.com" onclick="javascript:history.go(-1)"> Link </a>
What's the fix?
You should use window.history and return a false so that the href is not navigated by the browser ( the default behavior ).
window.history
href
<a href="www.mypage.com" onclick="window.history.go(-1); return false;"> Link </a>
1.4m articles
1.4m replys
5 comments
57.0k users