forked from estelle/jsintro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
part_05.html
141 lines (111 loc) · 2.76 KB
/
part_05.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!doctype HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Intro to JavaScript: Part 5</title>
<link href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono|Tangerine" rel="stylesheet" type="text/css" />
<link href="css.css" rel="stylesheet"/>
</head>
<body>
<div id="topinfo">
</div>
<div id="info">
<p>Press <span class="key">→</span> key to advance.
Zoom in/out: <span class="key">Ctrl or Command</span> + <span class="key">+/-</span>.
</p>
</div>
<div id="presentation">
<div id="presentation-counter"></div>
<div id="slides">
<div class="slide intro">
<header><hgroup>
<h1>Basic JavaScript: V</h1>
<h2>Estelle Weyl</h2>
<h3>Stuff we're skipping</h3>
</hgroup></header>
</div>
</section>
</div>
<div class="slide normal">
<header><h1>Regular Expressions</h1></header>
<section class="content">
<ul>
<li>regularExpression object</li>
<li>regEx syntax</li>
<li>search and replacing with regEx</li>
</ul>
<pre contenteditable></pre>
</section>
</div>
<div class="slide normal">
<header><h1>Date Objects</h1></header>
<section class="content">
<ul>
<li>var today = new Date();</li>
<li>var year = today.getFullYear();</li>
<li>var month = today.getMonth(); // 0 - 11</li>
<li>var date = today.getDate(); // 1 - 31</li>
<li>var dayOfWeek = today.getDay(); // 0 - 6</li>
</ul>
</section>
</div>
<div class="slide normal">
<header><h1>Number</h1></header>
<section class="content">
<ul>
<li>isNaN(x);</li>
<li>parseInt(x);</li>
<li>parseFloat(x);</li>
<li>num.toFixed(n)</li>
<li>Math.Round(x);</li>
<li>Math.floor(x)</li>
<li>Math.sqrt(x)</li>
<li>Math.abs(x)</li>
</ul>
<pre contenteditable></pre>
</section>
</div>
<div class="slide normal">
<header><h1>Switch statement</h1></header>
<section class="content">
<pre contenteditable>var rainbow = prompt('Color');
var teletubby;
switch (rainbow.toLowerCase()) {
case "purple":
teletubby = "Tinky Winky";
break;
case "green":
teletubby = "Dipsy";
break;
case "yellow":
teletubby = "Laa-Laa";
break;
case: "red":
teletubby = "Po";
break;
default:
teletubby = "You don't watch enough TV";
}
</pre>
</section>
</div>
<div class="slide normal">
<header><h1>Ternary Operator</h1></header>
<section class="content">
<pre contenteditable>
(condition)? if true : if false;
var IQ = () ? "glowing" :
</pre>
</section>
</div>
<div class="slide intro">
<header><h1>Next</h1></header>
<section class="content">
<a href="part_06.html">Go</a>
</section>
</div>
</div>
<iframe src="console/index.html" id="console" frameborder="0"></iframe>
</div>
<script src="slides.js"></script>
</body> </html>