-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhasher.html
45 lines (43 loc) · 832 Bytes
/
hasher.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
<!DOCTYPE HTML>
<html>
<head>
<title>Hasher Test Page</title>
</head>
<script src=hasher.js></script>
<body>
<script>
Hasher({
'': function(){
document.body.style.backgroundColor = 'yellow'
},
'page': function(){
document.body.style.backgroundColor = 'black'
}
});
Hasher({
'next': function(){
document.body.style.backgroundColor = 'purple'
window.onclick = function(){
Hasher('next/2');
}
},
'next/2': function(){
document.body.style.backgroundColor = 'green'
},
//this will be removed
'': false
},{
default: function(){
document.body.style.backgroundColor = 'red';
document.body.innerHTML = 'ups this page does not exist';
},
beforeEach: function(){
document.body.innerHTML = '';
}
});
window.onclick = function(){
Hasher('page');
}
</script>
</body>
</html>