<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>window对象a</title>
<script type="text/javascript">
//window浏览器窗口
// var name = "siki";
// console.log(window.name);
// window.document.getElementById();
// window.alert();
// window.setInterval();
// window.setTimeout();
// var res = window.confirm("你确定要杀我吗?");
// console.log(res);
// var res = window.prompt("请输入你的性别:");
// console.log(res);//输入结果,确定才会显示输入的内容,点击取消,显示null。
// function myopen(){
// var w = window.open("http://www.sikiedu.com","new_window","width=500,height=500");
// w.resizeTo(400,400);
// w.moveTo(200,500);
// // w.close();
// w.focus();
// }
//window.screen
// console.log(screen.availWidth);
// console.log(screen.availHeight);
// window.location
// console.log(location.protocal);
// console.log(location.hostname);
// console.log(location.port);
// console.log(location.pathname);
// console.log(location);
// location.assign("603-广告弹框.html");
// window.history
// history.go(-2);
</script>
</head>
<body>
<p>window对象-A</p>
<a href="701-window对象b.html">下一个页面</a>
<button onclick="history.back()">后退</button>
<button onclick="history.forward()">前进</button>
<button onclick="myopen()">打开</button>
</body>
</html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>window对象-B</title>
</head>
<body>
<p>window对象-B</p>
<a href="701-window对象c.html">下一个页面</a>
<button onclick="history.back()">后退</button>
<button onclick="history.forward()">前进</button>
</body>
</html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>window对象-C</title>
</head>
<body>
<p>window对象-C</p>
<a href="">下一个页面</a>
<button onclick="history.back()">后退</button>
<button onclick="history.forward()">前进</button>
</body>
</html>
history( window.history )
window.history 对象包含浏览器的历史。
history.back() - 与在浏览器点击后退按钮相同
history.forward() - 与在浏览器中点击按钮向前相同
history.go(-2) 后退两步