履歴オブジェクト
historyオブジェクト
length:履歴レコードの數(shù)
go(n):「進(jìn)む」と「戻る」を同時(shí)に実現(xiàn)できます
。 go(0) ウェブページを更新
history.go(-1) 戻る
history.go(1) 一歩前進(jìn)
history.go(3) 三歩前進(jìn)
-
forward(): ブラウザの「進(jìn)む」ボタンと全く同等
back(): ブラウザの「戻る」ボタンと同等
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> </head> <body > <a href="http://ipnx.cn">php中文網(wǎng)</a> <input type="button" value="前進(jìn)一步" onclick="history.go(1)"> </body> </html>