The history object of the JavaScript browser object model (BOM)

Source: Internet
Author: User

The history object is a property of the window object that holds the user's online record, from the moment the window is opened.

I. Properties of the History object
    

You can get the history and the number of records by judging the history.length.

alert (history.length);

Ii. methods of the History object

    

    function// jump to previous URL        history.back ();    }
function // jump to next URL         History.forward ();    }

The Go () method can load a specific page in the History list.

The URL parameter uses the URL to be accessed, or a substring of the URL. The number parameter uses the relative position of the URL to be accessed in the history's URL list.

The following example loads the previous page in the History list:

function GoBack () {        window.history.go (-1)    }

The history object of the JavaScript browser object model (BOM)

Related Article

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.