-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
34 lines (31 loc) · 810 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<nav>
<a href="/about" class="router-link">lien 1</a>
<a href="" class="router-link">lien 2</a>
<a href="" class="router-link">lien 3</a>
<a href="/yeah" class="router-link">lien 4</a>
<a href="" class="router-link">lien 5</a>
<a href="toto" class="router-link">lien 6</a>
</nav>
<script src="router.js"></script>
<script>
Router
.on('yeah', function() {
console.log('yeah')
})
.on('/toto', function() {
console.log('toto')
})
.on('/:id/test', function(id) {
console.log('test, ' + id);
})
.start();
</script>
</body>
</html>