-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
127 lines (101 loc) · 2.25 KB
/
demo.html
File metadata and controls
127 lines (101 loc) · 2.25 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="UTF-8">
<title>test</title>
<meta name="viewport" content="width=640,target-densitydpi=device-dpi,user-scalable=no" />
</head>
<div class="btn">
buttom 00000000000000
</div>
<div>
first commit
</div>
<div>
second commit
</div>
<script>
// function foo() {
// "use strict";
// console.log(this);
// console.log(this.a);
// }
// var a = 2;
// foo();
</script>
<script>
function foo(something) {
console.log(this.a, something);
return this.a + something;
}
function bind(fn, obj) {
return function () {
return fn.apply(obj, arguments);
}
}
var obj = {
a: 2
};
var bar = bind(foo, obj);
var b = bar(3);
console.log(b);
</script>
<script>
let myObject = {
get a() {
return this._a_;
},
set a(v) {
this._a_ = v * 4;
}
}
Object.defineProperty(myObject, 'b', {
get() {
return this.a * 5;
},
set(v) {
console.log('v', v);
this.a = 100 * v;
},
enumerable: true
})
myObject.a = 10;
console.log(myObject.a);
console.log(myObject.b);
myObject.b = 3;
console.log(myObject.b);
console.log(myObject.a);
</script>
<script>
function Mother(age) {
this.age = age;
this.hobby = ["running", 'football'];
}
Mother.prototype.showAge = function () {
console.log(this.age);
}
function Person(name, age) {
// Mother.call(this, age);
this.name = name;
}
Person.prototype = new Mother();
Person.prototype.constructor = Person;
Person.prototype.showName = function () {
console.log(this.name);
}
let p1 = new Person('Jack', 20);
p1.hobby.push('backetball');
let p2 = new Person('Mark', 18);
console.log('p1', p1);
console.log('p2', p2);
</script>
<body>
<div>
<img src="imgs/code.jpg" alt="二维码图片" />
</div>
<div style="position:absolute; top:660px; left:225px; z-index:1000;">
<img src="imgs/code.jpg" alt="二维码图片" />
</div>
<div>第一行</div>
</body>
</html>