History操作历史记录
History操作歷史記錄
Window.history.back()后退
Window.history.forward()前進
Window.history.go(-1)后退 為1為前進
?
?
頁面一:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>演示文檔</title>
</head>
<body>
<a href="my.html">我的個人主頁</a>
</body>
</html>
?
頁面二my.html
?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>history演示文檔</title>
</head>
<body>
<a href="javascript:window.history.back()">后退</a>
<a href="javascript:window.history.go(1)">前進</a>
</body>
</html>
?
?
?
總結
以上是生活随笔為你收集整理的History操作历史记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何实现在网页复制后加上网站的来源hre
- 下一篇: document的window对象