JavaScript对象历史记录如何将URL存储到其堆栈中?

问题描述 投票:0回答:2

我将此历史记录登录到window.history对象中,当前页面为5。

5) http://myapp.com/great-new-story/01242020.html
4) http://myapp.com/great-new-story/01052020.html
3) http://myapp.com/great-new-story/12012019.html
2) http://myapp.com/allnews.html
1) http://myapp.com

然后我要转到第allnews.html页(或第2号),allnews.html是否将登录到第6号?

否则它将不会被记录,因为allnews已经在堆栈中,所以它将使用(第2个?)>

我将此历史记录记录在window.history对象中,当前页面为5。 5)http://myapp.com/great-new-story/01242020.html 4)http://myapp.com/great-new-story/01052020.html 3)http:// myapp ....] >

javascript javascript-objects browser-history
2个回答
0
投票

AFAIK它将推入一个新按钮,因为简单的事实,它也用于后退和前进导航按钮,所以应该是这样,我也检查了一下。创建了一个新标签>打开google.com搜索了一些内容并基本上将其重定向,因此window.history的长度增加了,然后在多功能。我写了google.com的搜索栏-window.history的长度再次增加。

正如我所说,应该是用于后向和前向堆栈维护


0
投票

这里是一个简单的实验:

© www.soinside.com 2019 - 2024. All rights reserved.