使用window.location.href返回2页并重新加载 [英] Use window.location.href to go 2 pages back and reload

查看:149
本文介绍了使用window.location.href返回2页并重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以告诉 window.location.href 返回历史记录中的2页并重新加载被调用的页面?

Is it possible to tell window.location.href to go back 2 pages in history and reload the page that is called?

我只是设法让它像这样工作:

i only managed to get it to work like this:

<script type="text/javascript">
window.location.href = "http://www.google.com/";
</script>

我尝试使用命令 history.back(-2)在我的情况下不起作用。

Everything else i try with the command history.back(-2) does not work in my case.

推荐答案

你应该使用 history.back (2); ,而不是 history.back(-2);

这篇关于使用window.location.href返回2页并重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆