History.forward()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
History.forward()
메서드는 브라우저가 세션 기록의 바로 앞 페이지로 이동하도록 지시합니다. history.go(1)
과 같습니다. 다음 페이지가 없는 경우 아무것도 하지 않습니다.
이 메서드는 비동기적입니다. popstate
이벤트 처리기를 통해 탐색 완료 시점을 알 수 있습니다.
구문
js
history.forward();
예제
다음 예제는 클릭했을 때 앞으로 가는 버튼을 생성합니다.
HTML
html
<button id="go-forward">앞으로 가기!</button>
JavaScript
js
document.getElementById("go-forward").addEventListener("click", (e) => {
window.history.forward();
});
명세
Specification |
---|
HTML # dom-history-forward-dev |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
forward |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.