FireFox和Safari的history.go(-1)替代方案

时间:2022-04-10 17:17:30

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

对于FireFox和Safari,是否有history.go(-1)的替代方案。任何帮助将不胜感激。

2 个解决方案

#1


8  

You can use history.back().

您可以使用history.back()。

#2


1  

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

Should work though.

应该工作。

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

因为,实际上,以下内容在Firefox中不起作用:

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

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

Is that what you were doing ?

那是你在做什么的?

#1


8  

You can use history.back().

您可以使用history.back()。

#2


1  

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

Should work though.

应该工作。

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

因为,实际上,以下内容在Firefox中不起作用:

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

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

Is that what you were doing ?

那是你在做什么的?