JavaScript基础----33JS浏览器对象-window对象

来源:互联网 发布:k米软件下载 编辑:程序博客网 时间:2024/06/06 09:05
<!DOCTYPE html><!--JS浏览器对象-window对象--><html><head lang="en">    <meta charset="UTF-8">    <title></title></head><body>   <!--输出浏览器的而高度和宽度-->    <script>        //打印浏览器的宽度和高度        //高度不包括进度条        document.write("高度"+window.innerWidth+":"+"宽度"+window.innerHeight);    </script>    <!--打开一个新窗口-->    <button id="btn" onclick="fangFa()">按钮</button>    <script>      function fangFa(){//          打开一个新窗口//          window.open("test08.html");          window.open("test08.html","windowname","height = 200, width = 100 top=100 width=100 toolbar = no menubar=no");      }    </script>   <!--关闭当前窗口-->   <button id="btn1" onclick="fangFa()">按钮2</button>   <script>       function fangFa(){       window.close();       }   </script></body>

</html>

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title></head><body>     第二个窗口</body></html>

0 0