Since history is a property of the Window object, every browser window, every TAB, and even every frame has its own History object associated with a particular Window object

The following three methods and an attribute are commonly used for history:

history.go()

Receives an integer number or string argument: Jumps to the page whose most recent record contains the specified string

Go ('maixaofei.com') // Go forward or backward to the specified string page, no response if not found history.go(3) // forward to three records history.go(-1) // backward to one recordCopy the code

history.forward()

Jump forward one page

history.back()

Jump backwards to a page

history.length

If it is the first page opened, then history.length == 0, which can be used to determine whether the currently opened web page is the first page opened in the window