Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to history.go(-1) for FireFox and Safari

Tags:

javascript

Is there an alternative to history.go(-1) for FireFox and Safari. Any Help would be greatly appreciated.


2 Answers

You can use history.back().

like image 139
Anteru Avatar answered Mar 11 '26 19:03

Anteru


<a href="javascript:history.go(-1)">Link</a>

Should work though.

Because, indeed, the following does not work in Firefox:

<a href="#" onclick="Javascript:goback();">some Text</a>

function goback() {
   history.go(-1);
}

Is that what you were doing ?

like image 28
VonC Avatar answered Mar 11 '26 18:03

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!