Introduction to Properties of history history objects in JS

Source: Internet
Author: User

This property returns the and of the number of addresses that are contained under "forward" and "back" two keys. I don't seem to use this property very often, and I don't use it very much.

The history object provides three ways to access the history list:


History.back () Loads the previous URL in the History list, which is equivalent to pressing the back button.

History.forward () loads the last URL (if any) in the history list, which is equivalent to pressing the "forward" button.

History.go () opens a URL in the history list. To use this method, you must specify a positive or negative number in parentheses. For example History.go (-2) is equivalent to pressing the "back" button two times.

Go () Usage: history.go (x); In the range of history to a specified address. If x < 0, back x address, if x > 0, Forward x address, if x = = 0, refresh the page that is now open. History.go (0) is equivalent to Location.reload (). This is better, I never know history.go can return a few layers of

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.