![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/dea57f950094bf89312573d6e8595ecf.png)
两个location是一样的
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>064location对象方法</title>
<script>
alert(window.location===window.document.location);
</script>
</head>
<body>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/6c53f1b2bc90398daa8b2364d284c5f2.png)
location对象方法
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b0c8d6468f9fd257764fcb342ba22b85.png)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>064location对象方法</title>
<script>
alert(window.location===window.document.location);
</script>
</head>
<body>
<button onclick="location.assign('https://www.baidu.com')">assign</button>
<button onclick="location.replace('https://www.baidu.com')">replace</button>
<button onclick="location.reload(true)">reload</button>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b99e9dea712d0aedfcb9d50bcf1719bd.png)