From 28fc83ead53196104779b628652c12ce0c5c4b5c Mon Sep 17 00:00:00 2001 From: x270 <42441861+x270@users.noreply.github.com> Date: Thu, 6 May 2021 02:31:56 +0900 Subject: Docs/Web/API/History/forward を新規翻訳 (#569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Docs/Web/API/History/forward を新規翻訳 2021/02/21 時点の英語版に基づき翻訳 * Update index.html レビューコメントの反映 --- files/ja/web/api/history/forward/index.html | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ja/web/api/history/forward/index.html (limited to 'files/ja') diff --git a/files/ja/web/api/history/forward/index.html b/files/ja/web/api/history/forward/index.html new file mode 100644 index 0000000000..5e55df100b --- /dev/null +++ b/files/ja/web/api/history/forward/index.html @@ -0,0 +1,71 @@ +--- +title: History.forward() +slug: Web/API/History/forward +tags: + - API + - HTML DOM + - History + - History API + - Method + - Reference + - Web +translation_of: Web/API/History/forward +--- +
{{APIRef("History API")}}
+ +

History.forward() メソッドにより、ブラウザーはセッション履歴の一つ次のページに移動します。これは {{domxref("History.go", "history.go(1)")}} を呼び出すのと同じ効果があります。

+ +

このメソッドは{{glossary("asynchronous", "非同期")}}です。移動が完了したことを検知したい場合は {{event("popstate")}} イベントのリスナーを追加してください。

+ +

構文

+ +
history.forward()
+ +

+ +

以下の例では、セッション履歴の一つ次のステップへ進めるボタンを作成します。

+ +

HTML

+ +
<button id='go-forward'>Go Forward!</button>
+ +

JavaScript

+ +
document.getElementById('go-forward').addEventListener('click', e => {
+  window.history.forward();
+})
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("HTML WHATWG", "browsers.html#history", "History")}}{{Spec2("HTML WHATWG")}}{{SpecName("HTML5 W3C")}} から変更なし
{{SpecName("HTML5 W3C", "browsers.html#history", "History")}}{{Spec2("HTML5 W3C")}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.History.forward")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf