-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (80 loc) · 2.25 KB
/
index.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="vcheck.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var unknownType = "I am a string";
VCheck(unknownType, {
'function': function(value){
console.log('I am a function!');
},
number: function(value){
console.log('I am a number!');
},
string: function(value){
console.log('I am a string!');
}
});
VCheck(unknownType, {
'function': function(value){
console.log('I am a function!');
},
number: {
'true': function(value){
console.log('I am a number!');
},
'false': function(value){
console.log('I am not a number!');
}
},
string: function(value){
console.log('I am a string!');
}
});
//change to number
unknownType = 9001;
VCheck(unknownType, {
typeSensitive: false,
'function': function(value){
console.log('I am a function!');
},
number: function(value){
if(value > 9000)
console.log("I'm over 9000!");
},
finite: function(value){
if(value > 9000)
console.log("I'm over 9000!");
},
string: function(value){
console.log('I am a string!');
}
});
v($('#div')[0], {
'keyup': {
'D': function(e){
console.log(e.type);
}
},
'mouseevent': {
'left': function(e){
console.log(e.type);
}
}
});
});
</script>
<title>New Web Project</title>
</head>
<body>
<div style="width: 500px; height: 500px;" id="div">
<button id="button"> Click me</button>
<textarea> </textarea>
</div>
</body>
</html>