-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
94 lines (83 loc) · 2.78 KB
/
test.html
File metadata and controls
94 lines (83 loc) · 2.78 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
<!DOCTYPE html>
<html lang="en">
<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>test</title>
<style>
input[value*=click]{
color:red;
font-size: 20px;
}
</style>
</head>
<body>
<input type="button" value="click">
<input type="button" value="cladick-213></click-213>">
<input type="text" value="name:tom" />
<!-- <script src="event.js"></script>
<script src="type.js"></script>
<script src="string.js"></script> -->
<script src="U.js"></script>
<script>
function callback1(){
console.count('debounced');
}
function callback2(){
console.count('not debounced');
}
window.addEventListener('resize',U.debounce(callback1,300));
window.addEventListener('resize',callback2);
function getFunc(min,max){
if(typeof min !== 'number' || typeof max !== 'number') throw new RangeError('min and max should be numbers');
if(max <= min) throw new RangeError('min should smaller than max');
return function(n){
console.log(min,max)
if(n===null)return [];
if(typeof n !== 'number')return [];
if(n<min || n >max)return [];
var res = [],
del = Math.abs(max - min);
// console.log(del,min);
for(var i=0;i<n;i++){
// console.log(num);
var num = Math.floor(Math.random()*100) % (del + 1) + min;
var flag = true;
for(var j=0,len=res.length;j<len;j++){
if(res[j]===num){
flag = false;
break;
}
}
if(flag){
res.push(num);
}else{
i--;
}
}
return res;
}
}
var mergeTrees = function(t1, t2) {
// function getDepth(t){
// var depth = 0;
// if(t.left===null && t.right===null){
// return depth;
// }
// if(t.left!==null){
// ldepth = getDepth(t.left);
// }else{
// ldepth = 0;
// }
// if(t.right!==null){
// rDepth = getDepth(t.right);
// }else{
// rDepth = 0;
// }
// return Math.max(ldepth,rdepth) + 1;
// }
};
</script>
</body>
</html>