window对象

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // history 对象
    // 返回上一页
    window.history.back();
    // 跳转下一页
    window.history.forward();
    // 跳转指定页,正数为前进,负数为后退
   window.history.go();  

    // location 对象
    // 当前页面的url地址
    window.location.href;
    // 重载页面
    window.location.reload();
    // 修改url地址
    window.location.assign('http://www.qq.com');
    // 替换当前url地址, 和assign的区别在于replace不会留下历史记录
    window.location.replace('http://www.baidu.com');
    // 页面的加载事件,页面加载完成触发
    window.onload 
     // onchange 元素的值发生变化的时候触发
     btn.onchange
//
The achievement is attributed to miss peng
</script>
</body></html>
原文地址:https://www.cnblogs.com/zpdbkshangshanluoshuo/p/10061543.html