这篇翻译不完整。请帮忙从英语翻译这篇文章

History.length是一个只读属性,返回当前session中的history个数,包含当前页面在内。举个例子,对于新开一个tab加载的页面当前属性返回值1。

 

语法

 

length = history.length;

例子

var result = window.history.length; // 返回当前session中的history个数

说明

说明 状态 注释
HTML Living Standard
History.length
Living Standard No change from HTML5.
HTML5
History.length
Recommendation Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
lengthChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

参考

  • The History interface it belongs to.

文档标签和贡献者

此页面的贡献者: chenqingyue, mdnwebdocs-bot, poppyLuo
最后编辑者: chenqingyue,