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空间");
![](https://img.haomeiwen.com/i16719466/c27039d2d8fb3714.png)
confirm("欢迎来到Camel空间");
![](https://img.haomeiwen.com/i16719466/96664fc952aec8ba.png)
prompt("1");
HTML DOM open() 方法
open("http://wwww.baidu.com","百度","resizable=no");
![](https://img.haomeiwen.com/i16719466/d52ef0e3d4aec36d.png)
用法跟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>
网友评论