window的一些属性

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="智能社 - zhinengshe.com">
<meta name="copyright" content="智能社 - zhinengshe.com">
<title>智能社 - www.zhinengshe.com</title>
<script>
// alert(window.navigator.userAgent); 浏览器信息
// alert(window.navigator.language); 语言
// alert(window.navigator.platform); 操作系统

// http://www.baidu.com/abc.html?name=harry&age=18#link
// alert(window.location);
// alert(window.location.protocol); http:
// alert(window.location.host);        www.baidu.com
// alert(window.location.pathname); /abc.html
// alert(window.location.search);   ?name=harry&age=18
// alert(window.location.hash);        #abc

// alert(window.screen.width);        宽度
// alert(window.screen.height);        高度

</script>
</head>

<body>
    <input type="button" value="前进" onclick="window.history.go(1);" />
    <input type="button" value="后退" onclick="window.history.go(-1);" />
    <br />
    
    <input type="button" value="前进" onclick="window.history.forward();" />
    <input type="button" value="后退" onclick="window.history.back();" />
    <br />
</body>
</html>
原文地址:https://www.cnblogs.com/heboliufengjie/p/4163033.html