一,将今日在课堂上讲的三个页面之间的跳转写出来,注意history对象的使用
1,如图所示:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<input type="button" id="btn1" value="打开index2.html" />
<script type="text/javascript">
document.getElementById("btn1").onclick=function () {
location.assign("index2.html")
}
</script>
</body>
</html>
2,如图所示:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="button" id="btn1" value="back" />
<input type="button" id="btn2" value="打开index3.html" />
<input type="button" id="btn3" value="forward()" />
<input type="button" id="btn4" value="go" />
<script type