This course provides a complete
solution for delivering private or public technical training. Students learn to
use JavaScript effectively to make their web pages more dynamic and functional
and to reduce the number of roundtrips to the server.
Learning
Objectives
-
Learn how JavaScript is used
-
Learn JavaScript syntax
-
Learn about objects, methods,
and properties
-
Work with JavaScript variables
-
Create your own functions in
JavaScript
-
Write flow control logic in
JavaScript
-
Validate forms with JavaScript
-
Create roll-over images with
JavaScript
-
Open and work with new windows
-
Work with JavaScript timers and
intervals
-
Work with the navigator history,
and location objects
-
Review JavaScript functions and
the DOM
-
Introduce / Review
XmlHttpRequest and JSON
-
Use advanced techniques, such as
anonymous function
-
Use regular expressions for
advanced form validation
-
Create dynamic forms with
JavaScript
-
Create dynamic web applications
with JavaScript and Dynamic HTML
-
Check for browser support on a
feature by feature basis
-
Create dynamic menus
-
Create stunning visual effects
with Dynamic HTML
-
Position elements dynamically
-
Modify content on the fly
Prerequisites: Experience in HTML is required. Experience CSS
would be beneficial.
Course
Outline
-
JavaScript Basics
-
The Name "JavaScript"
-
The HTML DOM
-
JavaScript Syntax
i. Basic Rules
ii. Dot Notation
iii. Square Bracket Notation
-
Where Is JavaScript Code
Written?
-
JavaScript Objects, Methods and
Properties
i. Methods
ii. Properties
iii. The Implicit window Object
iv. The getElementById() Method
-
Event Handlers
-
Variables, Arrays and
Operators
-
JavaScript Variables
i. A Loosely-typed Language
ii. Storing User-Entered Data
-
Arrays
i. Associative Arrays
ii. Array Properties and Methods
-
JavaScript Operators
-
JavaScript Functions
-
Built-in Functions
i. Number(object)
ii. String(object)
iii. isNaN(object)
iv. parseFloat() and parseInt()
-
Built-in Functions vs. Methods
-
User-defined Functions
i. Function Syntax
ii. Passing Values to Functions
iii. A Note on Variable Scope
iv. Returning Values from Functions
-
Built-In JavaScript Objects
-
String
-
Math
-
Date
-
typeof Operator
-
Conditionals and Loops
-
Conditionals
i. if - else if - else Conditions
ii. Switch / Case
-
Loops
i. while Loop Syntax
ii. do...while Loop Syntax
iii. for Loop Syntax
iv. for...in Loop Syntax
-
JavaScript Form Validation
-
Accessing Form Data
-
Basics of Form Validation
i. The this Object
ii. Cleaner Validation
-
Validating Radio Buttons
-
Validating Checkboxes
-
Validating Select Menus
-
Focus, Blur, and Change Events
i. Focus and Blur
ii. Change
-
Validating Textareas
-
Images, Windows and Timers
-
Image Rollovers
-
Preloading Images
-
Creating a Slide Show
-
Windows
-
Timers
-
Popup Timed Slide Show
-
Navigator, History, and
Location Objects
-
The navigator Object
-
Feature Detection
-
history Object
-
location Object
-
Creating a Simple Quiz
-
Quick JavaScript Recap
-
Primitive data types
i. Null
ii. Undefined
iii. Boolean
iv. Number
v. String
-
Native Types
i. Date
ii. Array
iii. Object
iv. Regular Expressions
-
Functions
-
The DOM
i. The DOM is not JavaScript
ii. JavaScript is not the DOM
iii. The window object
-
The XMLHttpRequest object
-
JSON
-
Advanced Techniques
-
Optional Function Arguments
-
Truthy and Falsy
-
Default Operator
i. Default Operator Gotcha!
-
Functions Passed as Arguments
-
Anonymous Functions
-
Inner Functions
-
Observing and Capturing Events
-
The eval() Function
-
Variable Scope
-
Error Handling
i. Runtime Errors
-
The delete Operator
-
Regular Expressions
-
Getting Started
i. JavaScript's Regular Expression Methods
ii. Flags
iii. String Methods
-
Regular Expression Syntax
i. Start and End ( ^ $ )
ii. Number of Occurrences ( ? + * {} )
iii. Common Characters ( . \d \D \w \W \s \S )
iv. Grouping ( [] )
v. Negation ( ^ )
vi. Subpatterns ( () )
vii. Alternatives ( | )
viii. Escape Character ( \ )
-
Backreferences
-
Form Validation with Regular
Expressions
-
Cleaning Up Form Entries
-
The HTML Document Object
Model
-
innerHTML
-
Accessing Element Nodes
i. getElementById()
ii. getElementsByTagName()
iii. getElementsByClassName()
iv. querySelectorAll()
v. querySelector()
-
Accessing Element and Text Nodes
Hierarchically
-
Attaching Events
i. Event Propagation: Capturing and Bubbling
ii. Detaching Events
-
Accessing Attribute Nodes
i. getAttribute()
ii. attributes[]
-
Accessing Nodes by Type, Name or
Value
i. nodeType
ii. nodeName
-
Removing Nodes from the DOM
i. DOM Differences: The Whitespace Problem
-
Creating New Nodes
-
Identifying the Target of an
Event
-
Dynamic Forms
-
Jump Menus
i. The options[] Collection
ii. The selectedIndex Property
iii. Disabling Form Elements
-
Adding Options to a Select Menu
-
Cascading Select Menus
i. Making the Code Modular
-
Creating a JavaScript Timer
-
A Sample Quiz Tool
-
Dynamic HTML
-
Introduction
-
Accessing and Modifying Styles
-
JavaScript style Properties
-
Hiding and Showing Elements
-
Manipulating Tables
-
Dynamically Changing Dimensions
i. Creating a Timed Slider
-
Positioning Elements Dynamically
i. Creating a Different Timed Slider
-
Changing the Z-Index
-
A Note on JavaScript Frameworks