美文网首页Java学习笔记每天写500字IT@程序员猿媛
Javascript第五章DOM简介和window对象第一课

Javascript第五章DOM简介和window对象第一课

作者: 您好简书 | 来源:发表于2019-07-12 11:34 被阅读4次
在这里插入图片描述

ECMAScript参考:https://blog.csdn.net/qq_30225725/article/details/88621180
Javascript第五章window对象的事件常用方法第三课:
DOM参考:https://blog.csdn.net/qq_30225725/article/details/88624216

BOM参考:Javascript第五章history对象第四课:https://blog.csdn.net/qq_30225725/article/details/88624376

Javascript第五章location对象第五课
https://blog.csdn.net/qq_30225725/article/details/88624613

ECMAScript:核心的语法

Dom:文档对象模型

BOM:游览器对象模型

在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述
<!DOCTYPE html>
<html lang="zh">
<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>
    <script type="text/javascript">
        //对象名。属性名
        
        console.log(window.screen)
    </script>
</head>
<body>
    
</body>
</html>
在这里插入图片描述

里面有:

在这里插入图片描述

window的前缀可以不加

height width 方法 查看屏幕的分辨率大小

window中的常用10种方法

在这里插入图片描述

方法测试:

alert("欢迎来到Camel空间");

在这里插入图片描述

confirm("欢迎来到Camel空间");


在这里插入图片描述

prompt("1");


在这里插入图片描述
HTML DOM open() 方法
在这里插入图片描述
在这里插入图片描述
    open("http://wwww.baidu.com","百度","resizable=no");
在这里插入图片描述

用法跟open一样 区别:这个是模式窗口,窗口打开,必须在窗口执行关闭,才能对原窗口进行操作

源码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript">
        function doOpen(){
            //window.open("01.window对象的属性和方法.html");
            //open("01.window对象的属性和方法.html","page1");
            //open("01.window对象的属性和方法.html","page1","width=200,height=200");
            open("01.window对象的属性和方法.html","page1","width=300,height=300,resizable=no");
        }

        function doDialog(){
            window.showModalDialog("01.window对象的属性和方法.html","page1"); //Chrome不支持,Firefox支持
        }

        function doClose(){
            close(); //Chrome支持,Firefox不支持
        }
    </script>
</head>
<body>
    <input type="button" value="open" onclick="doOpen()">
    <input type="button" value="dialog" onclick="doDialog()">
    <input type="button" value="close" onclick="doClose()">
</body>
</html>

相关文章

网友评论

    本文标题:Javascript第五章DOM简介和window对象第一课

    本文链接:https://www.haomeiwen.com/subject/rllekctx.html