Home >Web Front-end >JS Tutorial >JavaScript introductory tutorial (7) History historical object_basic knowledge

JavaScript introductory tutorial (7) History historical object_basic knowledge

WBOY
WBOYOriginal
2016-05-16 18:56:231174browse

Due to security requirements, this object has received many restrictions and now only the following properties and methods remain. The History object has the length attribute, which lists the number of history items. The history that JavaScript can manage is limited to the range that can be reached using the browser's "forward" and "back" keys. This attribute returns the sum of the addresses contained under the "forward" and "backward" buttons.
History object has the following methods
back() to go back, which is equivalent to pressing the "Back" key.
forward() forward, which is equivalent to pressing the "forward" key.
go() Usage: history.go(x); Go to a specified address within the history range. If x < 0, go back x addresses, if x > 0, go forward x addresses, and if x == 0, refresh the now open web page. history.go(0) is equivalent to location.reload().

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn