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>