history對(duì)象
history對(duì)象
length:歷史記錄的個(gè)數(shù)
go(n):同時(shí)可以實(shí)現(xiàn)“前進(jìn)”和“后退?!?/p>
history.go(0) ?刷新網(wǎng)頁(yè)
history.go(-1) ?后退
?history.go(1) ??前進(jìn)一步
history.go(3) ??前進(jìn)三步
forward():相當(dāng)于瀏覽器的“前進(jìn)”按鈕
back():相當(dāng)于瀏覽器的“后退”按鈕
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> </head> <body > <a href="http://miracleart.cn">php中文網(wǎng)</a> <input type="button" value="前進(jìn)一步" onclick="history.go(1)"> </body> </html>