CPS616 Web Technologies Lectures on JavaScript I Basic Web Scripting Language and use in HTML Pages

3/3/99


Click here to start


Table of Contents

CPS616 Web Technologies Lectures on JavaScript I Basic Web Scripting Language and use in HTML Pages

Outline

General Remarks

Why would you use JavaScript I?

Why would you use JavaScript II?

Why would you use JavaScript III?

Why would you use JavaScript IV?

Version History

JavaScript 1.2

JScript 3.1

ECMAScript

Java vs. JavaScript I

Java vs. JavaScript II

Java vs. JavaScript III

Java vs. JavaScript IV

Performance Issues

JavaScript Basics

We Need to Know HTML!

JavaScript Scripts

“Hello World” Example

“Hello World” Example (cont’d)

Form Example

Form Example (cont’d)

Example of Parameterized HTML

The <SCRIPT> Tag

The <SCRIPT> Tag (cont’d)

The <SCRIPT> Tag (cont’d)

JavaScript URLs

JavaScript Entities

JavaScript Syntax

Basic Syntax

Variables

Operators

Expressions

Reserved Words

Statements

The if Statement

The switch Statement

The for Statement

The while Statement

The do…while Statement

The with Statement

JavaScript Core Objects

Basic Concepts

The Global Object

The eval Function

Parsing Functions

Other Global Functions

Built-in Objects

Array Objects

Array Methods

Boolean Objects

Date Objects

Date Methods

Function Objects

Function Arguments

The Math Object

Math Properties

Math Methods

Number Objects

Number Properties

Number Properties (cont’d)

Object Objects

RegExp Objects I

RegExp Objects II -- Examples

RegExp Objects III -- String Methods

Simple Regular Expression Patterns

Regular Expressions -- Special Characters

Grouping Patterns in Regular Expressions

Anchoring and Alternation in Regular Expressions

Parentheses in Regular Expressions

The Backslash \ Operator

Static Properties of RegExp Object I

Static Properties of RegExp Object II

Some Regular Expression Examples

Examples of Replace and test

Examples of match (string) and exec (RegExp)

Multiple Calls to exec Method

String Objects

String Methods

String Methods (cont’d)

JavaScript Events

Events

Event Handlers

Event Handlers (cont’d)

Event Handlers (cont’d)

Event Handler Examples

Event Object

Event Object (cont’d)

Client-side JavaScript

Object Hierarchy

Object Referencing

Window and Frame Objects

Window Properties

Window Properties (cont’d)

Frame Properties

Frame Example

Frame Example (cont’d)

Frame Example (cont’d)

Frameset Documents

Window and Frame Methods

History Object

Location Object

Document Object

Document Properties

Document Properties (cont’d)

Document Methods

Form Objects

Form Properties

Form Methods

Image Objects

Image Animation

Layer Objects

Built-in Arrays

HTML-reflected Arrays

Client-side String Methods

Navigator Objects

MimeType Objects

Plugin Objects

JavaScript Object Model

How to define Objects in JavaScript

User-defined Objects

User-defined Methods

Another Example

The prototype Property

The prototype Property (cont’d)

Prototype-based Inheritance

Author: Tom Scavo

Email: gcf@npac.syr.edu

Home Page: http://www.npac.syr.edu