如何让 Opera Javascript 保存重定向到历史记录以便history.go(-1) 工作?

发布于 2024-09-06 08:27:51 字数 301 浏览 1 评论 0原文

我正在使用 window.location* 跨多个页面进行重定向。

有 3 页,a、b、c。

a 链接到 b b 重定向到 c

然后我在 c 中使用 History.go(-1) 从 c 返回到 b,但在 Opera 中它会转到 a。

在 Opera 中什么会起作用?这在 IE8 和 Firefox 中是有效的,正如它应该的那样。

(* 也尝试了 window.location.href,仍然不起作用。 window.location.replace 不起作用,因为它会从历史列表中杀死 c ) )

I am using window.location* to redirect across a number of pages.

There are 3 pages, a, b and c.

a links to b
b redirects to c

I then use history.go(-1) in c to go back from c to b but in Opera it goes to a.

What would work in Opera? This works in IE8 and Firefox, as it should.

(* tried window.location.href too, still does not work.
window.location.replace would not work because it would kill c from the history list)
)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏花。依旧 2024-09-13 08:27:51

你试过把它绑在窗户上吗?

window.history.go(-1)

Did you try to tied it to the window?

window.history.go(-1)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文