In the AJAX lecture, we build a small web application, which you can download here.
You can get a blank HTML template here.
This quarter we will be using Piazza for class discussion. Please sign up here.
Course information can be found here.
In-class labs can be found here. (The labs are for practice only and will not count towards your final grade.)
What is JavaScript? Brief history. Common use-cases. Runtime environments. ECMAScript standards. Overview of language features. Running JavaScript in the browser and at the command line. Debugging JavaScript in the browser. The console and REPL. (Flanagan Chapters 1–2)
Values and literals. Primitive types. Numbers. Integer and floating point as a single type. Special floating point numbers. Rounding errors. The Math
library. Strings. Immutability of strings. +
and []
operators. toString
. Common string utilities. Booleans. Ternary operator. Truth-y and False-y values. null
and undefined
. Regular expressions. Dynamic typing. Weak typing. The typeof
operator. The ===
and !==
operators. Control statements. (Flanagan Chapters 3–5)
Arrays. Array insertion and deletion. Array length. Sparse arrays. Multidimensional arrays. Almost everything is an object. Objects as unordered maps. Object creation, modification and lookup syntax. Nested objects. Object methods. The delete
keyword. The for... in
statement, and the hasOwnProperty
method. The global window
object. Object references. Aliasing. Pass-by-reference-copy semantics. (Flanagan Chapters 6–7)
Function declaration and invocation syntax. Anonymous functions. Functions as data. The arguments
object. Variadic functions. Optional parameters. Named parameters. Function overloading. Duck typing. (Flanagan Chapter 8)
Tags. Document structure. Elements. Text, forms, images, blocks and frames. Selectors. Cascading and inheritence. Text and color tyles. The box model. Layout. The DOM as an document API. Browser information. The setTimer
and setTimeout
. Element lookup. Tree traversal. Attribute getting and setting. Creating and deleting nodes. Events. (Flanagan Chapters 15 and 16)
Overview of jQuery. Cross-browser compatibility. The $
function object. Element selectors. Tree traversal. Node creation, insertion, modification and deletion. Getting and setting attributes, styles and class. Wrapping and unwrapping DOM raw objects. The chaining pattern. (Flanagan Chapter 19)
Event handling. bind
and unbind
. Keyboard and mouse events. Event delegation and bubbling. Animation. (Flanagan Chapters 17, 19)
AJAX. Asynchronous communication. Callback functions. The get
and post
formats. Same-origin policy. Cross-origin requests with JSONP. AJAX polling. (Flanagan Chapter 19)
Object method invocation as method passing. The this
variable as an implicit parameter variable. Problems with methods in event handlers and callbacks. Usage of call
and apply
. Binding context. The new
keyword. (Course Reader)
Lexical scope. Inner functions. Closure scope. Examining closure scope in the debugger. Functors. Simulation of private object properties. Simulation of namespaces. (Crockford Chapter 4)
Functional programming. Side effects. Referential transparancy. Iteration over collections without loops. Implementation of map, reduce, find, filter. (Course Reader)
Implementation of curry, memoize, and debounce. (Course Reader)
Same-origin policy. Cross-site scripting attacks (reflected and persisted). Cookie theft and forgery. Whitelisting and blacklisting.
Server-side scripting. Threaded vs event-based server models. Working with callbacks. The Express web framework.
Guest lecture by Min Ming Lo, Pixelapse.
Guest lecture from Leith Abdulla, Coursera. The anatomy of a javascript module: the design, layout and components of a typical javascript library used to help a front-end team scale their work.
HTML 5 APIs.
Data visualization. Drawing graphics using SVG. Selections with select
and selectAll
. Adding and deleting elements with enter
and exit
. Binding data with data
. Animation with transition
. (Course reader)
Current trends in JavaScript. JIT engines. New EMCAScript features. The HTML5 roadmap. Alternative MVC frameworks: AngularJS, Ember.js, Knockout. CoffeeScript. Trends towards fat clients and API-based services. (Course reader)