-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path东边日出西边雨.html
108 lines (101 loc) · 3.33 KB
/
东边日出西边雨.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
<script>
/*function ajax(opt) {
opt = opt || {};
opt.method = opt.method.toUpperCase() || 'POST';
opt.url = opt.url || '';
opt.async = opt.async || true;
opt.data = opt.data || null;
opt.success = opt.success || function () {};
opt.list = opt.list || function () {};
var xmlHttp = null;
if (XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
var params = [];
for (var key in opt.data){
params.push(key + '=' + opt.data[key]);
}
var postData = params.join('&');
if (opt.method.toUpperCase() === 'POST') {
xmlHttp.open(opt.method, opt.url, opt.async);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
xmlHttp.send(postData);
}
else if (opt.method.toUpperCase() === 'GET') {
xmlHttp.open(opt.method, opt.url + '?' + postData, opt.async);
xmlHttp.send(null);
}
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
opt.success(xmlHttp.responseText);
}else{
opt.list()
}
};
}
ajax(
{
method: 'POST',
url: 'http://testapi.xinxuewen.cn/Member/login?api=Member.login&app_key=218fbc52&verson=1.0&t=1521186758&sig=98e442c42b418baed219383eb39395bd&sv=0',
data: {
mobile:18322222222 ,
password:123456
},
success: function (response) {
response=JSON.parse(response);
console.log(response.data.roominfo.starttime,new Date(response.data.roominfo.starttime*1000).toLocaleString());
}
}
)
console.log(new Date(1522994400000).toLocaleString());*/
/* var a=['1','2',3]
var b=[1,2,]
document.write(a)
function compare(array,the) {
// if the other array is a falsy value, return
if (!array)
return false;
// compare lengths - can save a lot of time
if (the.length != array.length)
return false;
for (var i = 0, l = the.length; i < l; i++) {
// Check if we have nested arrays
if (the[i] instanceof Array && array[i] instanceof Array) {
// recurse into the nested arrays
if (!(the[i]==(array[i])))
return false;
}
else if (the[i] != array[i]) {
// Warning - two different object instances will never be equal: {x:20} != {x:20}
return false;
}
}
return true;
}
console.log(compare(a, b));*/
</script>
<script>
const person = {
isHuman: false,
printIntroduction: function () {
console.log(`My name is ${this.name}. Am I human? ${this.isHuman}`);
}
};
const me = Object.create(person);
console.dir((me));
me.name = "Matthew"; // "name" is a property set on "me", but not on "person"
me.isHuman = true; // inherited properties can be overwritten
me.printIntroduction();
</script>