-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (56 loc) · 2.41 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
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<title>Page timeline</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css">
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crossfilter/1.3.12/crossfilter.js"></script>
</head>
<body>
<p>Cool simple page!</p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dc/1.7.5/dc.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js" async defer></script>
<script>
function recursive(n) {
if(n <= 2) {
return 1;
} else {
return this.recursive(n - 1) + this.recursive(n - 2);
}
}
console.warn('1. Starting recursive call (assume it will take 1 second)');
recursive(40);
console.warn('2. Getting data (assume the download will take 1 second)');
$.get('https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.js')
.then(
function(result) {
console.warn('3. Received data');
return new Promise(function(resolve) {
console.warn('4. Start processing data');
setTimeout(
function() {
console.warn('5. Actually start processing data (assume it will take 1 second)');
recursive(40);
resolve();
console.warn('6. Complete delayed processing');
},
0
);
console.warn('7. Done with promise');
});
}
)
.then(
function(result) {
console.warn('8. Done processing data');
}
);
console.warn('9. Done!');
</script>
<p>... and this is the rest of it!</p>
</body>
</html>