Window history.go() method
- 上一页 forward()
- 下一页 length
- 返回上一层 Window History
Definition and usage
history.go()
Method loads a URL (page) from the history list.
history.go()
Method is only valid when the page exists in the history list.
Comment
history.go(0)
Reload the page.
history.go(-1)
With history.back()
Same.
history.go(1)
With history.forward()
Same.
See also:
Example
Create a button to go back two pages:
<button onclick="history.go(-2)">Go back two pages</button>
The output of the above code will be:
Click back to see how it works.
(Yana dake a dukiya dake a kuduwa da kuduwa a dukiya kuduwa)
Syntax
history.go(number)
Parameter
Parameter | Description |
---|---|
number | Zaruri. Katanin dake a daidai. Yuki dake a aiki. |
Return value
Ba wani.
Dukiya suka
Dukiya dake a dukiya suka history.go()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
- 上一页 forward()
- 下一页 length
- 返回上一层 Window History