English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
history.lengthA read-only property returns an integer (Integer) representing the number of elements in the session history, including the currently loaded page.
This property at least returns1, because the list includes the currently loaded page.
This property is very useful for finding out how many pages the user has visited in the current browsing session.
history.length
var result = history.length; // Returns the size of the history of the current session.Test and See‹/›
All browsers fully support the history.length property:
Property | |||||
history.length | Yes | Yes | Yes | Yes | Yes |
Return Value: | A number indicating the number of entries in the session history |
---|
History Record Reference:history.back() method
History Record Reference:history.forward() method