History forward()メソッド

History 对象参考手册History オブジェクト

定義と用法

forward() メソッドは履歴リスト内の次の URL を読み込みます。

このメソッドを呼び出す効果は、進むボタンをクリックするか、history.go(1) を呼び出すのと同等です。

構文

history.forward()


ブラウザサポート

Internet ExplorerFirefoxOperaGoogle ChromeSafari

すべての主要ブラウザが forward() メソッドをサポートしています。


例

例

ページに進むボタンを作成します:

<!DOCTYPE html>
<html>
<head>
<script>
function goForward(){
    window.history.forward()
}
</script>
</head>
<body>

<input type="button" value="前进" onclick="goForward()">

</body>
</html>

上記の例の出力結果:


試してみる »


History 对象参考手册History オブジェクト その他の拡張