-
Notifications
You must be signed in to change notification settings - Fork 0
/
202002140954001--NEWfunction.html
53 lines (49 loc) · 1.27 KB
/
202002140954001--NEWfunction.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--
* @Author: [JokerChen]
* @Date: 2020-02-14 14:20:26
* @LastEditors: [JokerChen]
* @LastEditTime: 2020-05-26 10:57:41
* @Description:
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
<script type="text/javascript">
var arrFunction=["checkInfo","consoleInfo","alertInfo"];
console.log(arrFunction[0]);
var oInfo={
"UserName":"1111",
"UserPwd":"11112"
};
//直接通过window访问对应的属性去执行对应的函数
window[arrFunction[1]](oInfo);
//通过eval实现
function checkInfo(obj){
console.log("执行函数checkInfo"+obj.UserName);
}
function consoleInfo(oInfo){
console.log("执行函数consoleInfo");
}
function alertInfo(){
console.log("执行函数alertInfo");
}
//window 对象学习
//可用的屏幕宽度
let availWidth =window.screen.availWidth ;
let availHeight =window.screen.availHeight ;
// window Location(在控制台输入)
//返回web主机的域名
let hostname =window.location.hostname;
// 返回当前页面的路径和文件名
let pathname =window.location.pathname;
//返回所使用的web协议(http://或https://)
let protocol =window.location.protocol;
// 返回(当前页面的)整个URL
let hrefInfo = window.location.href;
</script>