Sep 18
Last week's homework
Discuss the CGI assignment.
Do we want to spend more time on this?
JavaScript
Where we're going :
1. The language itself - scope, objects, JSON, ...
2. The DOM - the object API of the HTML tags
3. 3rd party libraries - jQuery, Underscore, ...
How to run JavaScript in the browser
JavaScript resources
Javascript Language Syntax
defining variables and functions.
- use "var"
- assigning functions to variables
- numbers (all float ?!)
- strings and string manipulations
structures
- objects : {foo:1, bar:3} (i.e. python 'dictionaries')
- arrays : [3,10,'hello']
- ... but they're not as distinct as they are in other languages.
- json : a data exchange format based on this sort of syntax
conditionals, true, false, loops
scope and namespaces
- issues around loading multiple files in one web page
- anonymous functions as private scopes
- closure
- this
examples
Examples of where to run javascript in html :
Aside :