JavaScript Examples Demonstrated
This page contains contains working examples used in JavaScript handouts 1-4. To see an example in action, click the example.
JavaScript - Handout 1
- Hierarchy Example 1 - Writing to a Web Page
- Object Example 1 - Creating an Object and Assigning it Properties
- Object Example 2 - Assign Properties & Use Mathematical Operations
- Function Example 1 - Creating a Function, Properties, & Results
- Function Example 2 - Passing A Single Argument to a Function
- Function Example 3 - Passing Multiple Arguments to a Function
- "javascript" Example 1 & 2 - A link to Open and Close a Window
- "javascript" Example 3 - Generating a New Window from a Text Link
- "javascript" Example 4 - Generating a New Window from an Image Link
- Function Arguments Example 1: Multiple Thumbnails Generate New Windows
JavaScript - Handout 2
- Example 2 - Image Rollovers
- Example 3 - Text Rollovers
- Example 4 - Text Rollovers (Preloading Images)
- Example 5 - Multiple Image Rollovers Change Another Image
- Example 6 - Forms to Accept User Input (Calculating Area)
- Example 7 - Forms to Accept User Input (Convert Fahrenheit to Celsius)
JavaScript - Handout 3
- Array Example 1-Clicking Links Writes Text to a Text Field
- If Statement Example 1 - Check for Blank Form Fields
- Array, IF, Counter Example 1 - Building A Slide Show
- Array, IF, Counter Example 2 - Building A Wrap Around Slide Show
- Array, Counter, If Example 3 - Automatically Cycle Between Images
JavaScript - Handout 4
- Stationary Status Bar Text
- Scrolling Status Bar Text
- Dates Example 1 - Inserting The Current Date - Unformatted
- Dates Example 2 - Inserting Just the Current Year
- Dates Example 3 - Using an Array to Insert the Day or Month by Name
- Dates Example 4 - Using an Array to Insert the Day, Month, and Year
- Countdown Until Christmas