Unit 7
JavaScript
Make pages interactive: the JavaScript language, the DOM, events, timers, form validation and a complete 2D canvas game.
What you will learn
After this unit you can:
- Explain what JavaScript is and where it runs
- Add JavaScript to a page
- Declare variables and use data types, operators, control structures, arrays, objects and functions
Topics in this unit
7.1Introduction to JavaScript✓7.2JavaScript Usage: Internal and External✓7.3Variables✓7.4Control Structures✓7.5Objects and Arrays✓7.6Functions✓7.7The DOM (Document Object Model) Tree✓7.8.1Accessing elements (by name, ID, class)✓7.8.2Manipulating elements and styles✓7.8.3Working with forms✓7.8.4Handling events✓7.8.5Scheduling: setTimeout, setInterval, clearInterval✓7.9Form Validation✓7.10.1Canvas basics and the game loop✓7.10.2Sprite sheet animation✓7.10.3Key event handling✓7.10.4Object collider✓7.10.5Anonymous functions✓7.10.6Complete example: Coin Collector✓7.11Review Questions✓