forked from pearlchen/LLC-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs_debugging.html
145 lines (123 loc) · 6.13 KB
/
js_debugging.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
142
143
144
145
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ladies Learning Code - JavaScript March 18, 2012</title>
<meta name="viewport" content="width=1280">
<!-- CoderDeck core and extension CSS files -->
<link rel="stylesheet" href="src/deck.js/core/deck.core.css" type="text/css">
<link rel="stylesheet" href="src/deck.js/extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="src/deck.js/extensions/status/deck.status.css">
<link rel="stylesheet" href="src/deck.js/extensions/hash/deck.hash.css">
<link rel="stylesheet" href="src/deck.js/extensions/menu/deck.menu.css">
<link rel="stylesheet" href="src/css/prettify.css">
<link rel="stylesheet" href="src/css/deck.coder.css">
<link rel="stylesheet" href="src/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="src/codemirror/theme/default.css">
<!-- Custom for LLC -->
<link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Podkova' rel='stylesheet' type='text/css'>
<link rel="stylesheet" id='style-theme-link' href="src/css/coderdeck.css" type="text/css" >
<style type="text/css"></style>
</head>
<body class="deck-container">
<script type='text/coderdeck' id='coderdeck-default'>
<html>
<head>
<script src='src/jquery.min.js'>SCRIPTEND</head>
<body>CODE</body>
</html>
</script>
<script type='text/coderdeck' id='coderdeck-style-example'>
<html>
<title>test</title>
<style>CODE</style>
<body>
</body>
</html>
</script>
<div id="presentation">
<!-- **************************************** -->
<!-- SLIDE: -->
<article class='slide slide-subhead'>
<h1>Going Beyond JavaScript Basics</h1>
<p>You're getting to be quite the pro!</p>
</article>
<!-- SLIDE: -->
<article class='slide slide-subhead'>
<h1>Debugging!</h1>
<p>Squash those crawly things in your code.</p>
</article>
<!-- SLIDE: -->
<article class='slide slide-list'>
<h2>What's a Bug?</h2>
<p>As <a href="http://en.wikipedia.org/wiki/Grace_Hopper#Anecdotes" target="_blank">the story</a> goes, the term "software bug" got its name because a real moth flew into a computer system causing strange, unexpected behaviours to happen in a computer program. </p>
<p>Nowadays, bugs are mostly due to human error in one of two areas:</p>
<ol>
<li>
Syntax - missing semi-colons, typos, case-sensitivity</li>
<li>
Logic - trying to access a variable that doesn't exist yet, writing an incorrect conditional test</li></ol>
<p>Luckily there's a few things to help us hunt them down quicker...</p>
</article>
<!-- SLIDE: -->
<article class='slide slide-list'>
<h2>Chrome Developer Console</h2>
<p>Use the built in developer tools in Chrome to debug your code. (Firefox+Firebug is similar but not exactly the same.)</p>
<p>[Wrench Icon] > Tools > Developer Tools ( Alt+Cmd+L for Mac, Ctrl+L for Windows) Click on the Console tab.</p>
<p><img src="assets/ChromeConsole.gif" width="632" height="84" alt="Chrome debugger tabs" /></p>
</article>
<!-- SLIDE: -->
<article class='slide slide-list'>
<h2>Right click > Inspect Element</h2>
<p>Easiest way to remember is to right-click on any web page and select "Inspect Element". In the new panel, select the "Console" tab to see JavaScript errors or to play in the console sandbox.</p>
<p><img src="assets/ChromeInspector.gif" width="243" height="248" alt="Right click to see Inspect Element in the popup" /></p>
</article>
<!-- SLIDE: -->
<article class='slide slide-list'>
<h2>Inspecting the DOM</h2>
<p>You can inspect any webpage with the debugger. </p>
<p>Let's open up the Ladies Learning Code Events page: <a href="http://ladieslearningcode.com/events/" target="_blank">http://ladieslearningcode.com/events/</a>.</p>
<p>How can we use the console to find out how many events are listed on this page?</p>
</article>
<!-- SLIDE: -->
<article class='slide slide-list'>
<h2>More info</h2>
<ul>
<li><a href="https://developers.google.com/chrome-developer-tools/docs/overview" target="_blank">Chrome Developer Tools: Overview</a></li>
<li>Video: <a href="http://www.youtube.com/watch?v=N8SS-rUEZPg" target="_blank">Google I/O 2011: Chrome Dev Tools Reloaded</a></li>
<li>Video: <a href="https://www.youtube.com/watch?v=3pxf3Ju2row" target="_blank">Google I/O 2012 - Chrome Developer Tools Evolution</a></li>
</ul>
</article>
<!-- SLIDE: Next section -->
<!-- <article class='slide slide-list'>
<p class="centered vertically_centered"><a href="jquery-indepth.html"><img src="assets/next_section_icon.gif" width="230" height="70" alt="Click to go to next section" /></a></p>
</article> -->
</div>
<!-- END div id=presentation -->
<script src='src/jquery.min.js'></script>
<script src="src/modernizr.js"></script>
<!-- Update these paths to point to the correct files. -->
<script src="src/jquery.tmpl.min.js"></script>
<script src="src/deck.js/core/deck.core.js"></script>
<!-- Code Mirror -->
<script src="src/codemirror/lib/codemirror.js"></script>
<script src="src/codemirror/mode/xml/xml.js"></script>
<script src="src/codemirror/mode/css/css.js"></script>
<script src="src/codemirror/mode/javascript/javascript.js"></script>
<script src="src/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<!-- Prettify -->
<script src="src/prettify.js"></script>
<!-- Deck Core and extensions -->
<script src="src/deck.js/extensions/status/deck.status.js"></script>
<script src="src/deck.js/extensions/navigation/deck.navigation.js"></script>
<script src='src/deck.coder.js'></script>
<script src="src/deck.js/extensions/hash/deck.hash.js"></script>
<script src="src/deck.js/extensions/menu/deck.menu.js"></script>
<script>
$(function() {
$.deck('.slide');
});
</script>
</body>
</html>