Course Description
This two-day hands-on course provides a comprehensive introduction on how to program using this powerful interactive programming language.
Course Objectives
Upon successful completion of this course, students will be able to:
- Understand JavaScript syntax
- Apply fundamental JavaScript scripting techniques
- Create interactive JavaScript scripts
- Interact with the browser error-handling features
- Examine, test and manipulate data types
- Control the logical flow of scripts
- Create and use functions
- Create and instantiate objects
- Display and manipulate status messages
- Validate forms
- Read and write data to and from form elements
- Perform mathematical calculations
- Ensure cross-browser compatibility
Course Benefits
Students will quickly learn how to make Web pages interactive with JavaScript and acquire programming skills.
Who Should Attend
This course is valuable for anyone who would like to go beyond what basic HTML has to offer and add functionality and interactivity to their Web site using JavaScript.
Prerequisite
This course assumes students with enough HTML experience to be comfortable writing HTML with a simple text editor. Basic computer experience at the user level is expected.
Method Of Instruction
Lecture, demonstrations, questions and answers, and numerous hands-on exercises.
Hands-on Exercises
Throughout this course, students perform a series of extensive hands-on exercises including:
- Creating and embedding an interactive JavaScript script into a Web page
- Using the browser to examine script errors
- Using variables and data types
- Investigating the difference between undeclared and undefined variables
- Adding escape characters to a message
- Converting between data types
- Using and evaluating the increment operator
- Testing and overriding precedence
- Writing scripts with if statements
- Writing scripts with various looping statements
- Writing functions with multiple arguments
- Displaying alert, confirm and prompt dialog boxes
- Opening, writing to, and closing new windows
- Creating an image rollover
- Using JavaScript with frames
- Determining which radio button is checked
- Adding items to a select list
- Trimming unwanted white space from text box data
- Using regular expressions to validate form field data entry
- Display the date and time
- Create a running clock
- Rounding numbers generated by a lottery page
- Create a custom object
- Examine cookies
Course Outline
Chapter 1: OverviewChapter 2: Variables and Operators
- What is JavaScript
- What is NOT JavaScript
- Implementing JavaScript
- Script errors
- Programming basics
- JavaScript syntax
- Language components
- The <script> element and its attributes
- Making the code easy to read, write and debug
Chapter 3: Control Statements
- Data types
- Arrays
- Objects
- Variables
- Literals
- Increment operators
- Assignment operators
- Operator precedence
- Naming convention and reserved words
Chapter 4: Functions and Objects
- Logical operators
- If-Else If
- Switch
- For loop
- While loop
- Do while loop
Chapter 5: The Window Object
- Passing data to a function
- Functions with multiple arguments
- returning values
- Function libraries
- Object hierarchy
- Creating and destroying instances
- Built-in objects
- The global object
Chapter 6: The Document Object
- Properties, methods and event handlers
- Alert, prompt and confirm
- Status bar messages
- Opening and closing windows
- Adding content to new windows
Chapter 7: Frames
- The Document Object Model
- Manipulating form elements
- DHTML
- Cross-browser image rollovers
Chapter 8: Forms
- Accessing other frames
- Using frame names in scripts
Chapter 9: Strings
- The Form object
- Accessing forms
- Writing to form fields
- Reading from select lists
- Radio buttons
- check boxes
- Buttons
Chapter 10: Validating Forms
- The String Object
- Manipulating strings
- Substring methods
- Correcting data entry errors
Chapter 11: Intrinsic Mathematical Functions
- Test for empty fields
- Validating check boxes, radio buttons and select lists
- Using
onSubmit()
in the validation processChapter 12: Custom Objects
- Obtain the date and time
- Using and manipulating dates
- Clocks
- Date math
- The Math object
- Generating random numbers
- Rounding numbers
- Trigonometric functions
Chapter 13: Cookies and Security
- Creating a simple custom object
- Adding methods to objects
- Reading cookies
- Storing cookies
- Processing cookie values
- Deleting cookies
- JavaScript security features