Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

history.go(-1) going back doesnt work in Chrome

Tags:

javascript

href="#" onclick="closeOrCancel() and history.go(-1) in that js method doesnt work in Chrome (neither history.back())

It works with href="javascript:closeOrCancel()" , but Opera doesn't allow href="javascript:...

How to make history go back using onclick= "myFunction()" ?

Edit: closeOrCancel() returns false

like image 653
Stewie Griffin Avatar asked Jul 08 '10 18:07

Stewie Griffin


1 Answers

Adding a return false; to the onclick code seems to be enough:

<a href="#" onclick="closeOrCancel(); return false;">Go Back</a>
like image 72
TNi Avatar answered Oct 28 '22 00:10

TNi