JavaScript Basics

JavaScript is incredibly versatile. You can start small, with carousels, image galleries, fluctuating layouts, and responses to button clicks. With … Continue reading "JavaScript Basics"

Overview

JavaScript is incredibly versatile. You can start small, with carousels, image galleries, fluctuating layouts, and responses to button clicks. With more experience you’ll be able to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more!

Audience

Programmers/Web page designers familiar with HTML

Length

24 hours

Outline

Introduction to JavaScript

  • What is JavaScript?
  • The Document Object model
  • The Browser Object model

JavaScript in HTML

  • The <script> tag
  • Using external scripts/libraries

JavaScript and the browser

  • Viewing source code
  • Writing to the browser console
  • Using the browser to help debug your JavaScript

JavaScript language basics

  • JavaScript reserved words
  • JavaScript data types
  • Arithmetic operators
  • Logical operators
  • Comparision operators

JavaScript language statements

  • Assignment statements
  • Decision statements
  • Iteration (loops)
  • Output statements

JavaScript functions

  • What is a function?
  • Invoking functions
  • Passing data to functions
  • Receiving data from functions

Variables and scope

  • The importance of variable scope
  • Global variables
  • Local variables

JavaScript variable types

  • Value types
  • Reference types
  • The Date type
  • The Number type
  • The String type

JavaScript Arrays and Objects

  • JavaScript objects
  • JavaScript arrays

JavaScript events and HTML forms

  • Accessing form data with JavaScript
  • Responding to user input events
    1. Mouse events
    2. Keyboard events
    3. Window resize/move events
  • Responding to other events (page load/unload)

Error handling

  • Using try/catch blocks

JavaScript best practices