javascript javascript浏览器历史列表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17032415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
javascript browser history listing
提问by Brad
I am familiar with the window.history.back()and the window.history.forward()javascript objects. But is there a method of creating an array with the last "X" number pages viewed.
我熟悉window.history.back()和window.history.forward()javascript 对象。但是有没有一种方法可以创建一个数组,并查看最后一个“X”页数。
回答by Brad
No, this would be a huge security problem. You can get history.lengthto count them if you wish.
不,这将是一个巨大的安全问题。history.length如果您愿意,您可以数数它们。
回答by J Max
Check out:
查看:
How do you get the previous url in Javascript?
In short you can get the number of previous sites visited (history.length) but not the url's.
简而言之,您可以获得以前访问过的站点的数量 ( history.length) 但不能获得 url 的数量。

