-
Notifications
You must be signed in to change notification settings - Fork 5
/
footnotes.html
49 lines (41 loc) · 2.46 KB
/
footnotes.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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JavaScript-enhanced footnotes and references</title>
<link rel="stylesheet" href="footnotes.css" type="text/css">
<script src="footnotes.js"></script>
</head>
<body>
<h1>JavaScript-enhanced footnotes and references</h1>
<h2>About</h2>
Challenges:
<ul>
<li>On screen, show footnote content close to where the footnote is referenced.</li>
<li>Support touch devices.</li>
<li>In print, show footnotes as usual.</li>
<li>Degrade gracefully if JavaScript is switched off.</li>
</ul>
More information:
<ul>
<li>Companion blog post: “<a href="http://www.2ality.com/2011/12/footnotes.html">Handling footnotes and references in HTML</a>”</li>
<li>Project <a href="https://github.com/rauschma/html_demos">html_demos</a> on GitHub</li>
</ul>
<h2>Demonstration</h2>
You can use an IIFE<a class="ptr">(1)</a> to avoid the global namespace<a class="ptr">(2)</a> being polluted. JavaScript has many functional language constructs <a class="ptr">[1]</a>. For example: consult <a class="ptr">[2]</a> for an introduction to closures.
<h2>Footnotes</h2>
<ol id="footnotes">
<li>IIFE is an acronym for Immediately-Invoked Function Expression. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</li>
<li>The global scope is reified as an object in JavaScript. A <a href="http://www.example.com">link</a> to somewhere else.
One more line.
</li>
</ol>
<h2>References</h2>
<ol id="references">
<li><a href="http://en.wikipedia.org/wiki/Functional_programming"><i>Functional programming</i></a>. In <i>Wikipedia</i>. Retrieved 2011-12-03.
</li>
<li>Douglas Crockford, <i>JavaScript: The Good Parts</i>. O’Reilly. 2008-05-16.</li>
</ol>
</body>
</html>