I am using
<a href="index.php" onclick="history.back();return false;">Back</a>
to provide a back to previous page link. It works fine on Windows (IE/Mozilla) but fails in Safari on both Windows/Mac.
Is there a way to make it work on all of the systems/browsers (cross-browser/platform)?
If it's not possible, is there any other way using PHP etc?
it should be history.go(-1); return false;
or history.go(-1); event.preventDefault();
You should consider doing it like this instead:
<a href="javascript:history.go(-1)">Back</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With