Books & Videos

Table of Contents

  1. Chapter 1 Strings

    1. Introduction

    2. Concatenating (Joining) Strings

    3. Accessing Substrings

    4. Changing String Case

    5. Testing Equality of Two Strings

    6. Testing String Containment Without Regular Expressions

    7. Testing String Containment with Regular Expressions

    8. Searching and Replacing Substrings

    9. Using Special and Escaped Characters

    10. Reading and Writing Strings for Cookies

    11. Converting Between Unicode Values and String Characters

    12. Encoding and Decoding URL Strings

    13. Encoding and Decoding Base64 Strings

  2. Chapter 2 Numbers and Dates

    1. Introduction

    2. Converting Between Numbers and Strings

    3. Testing a Number's Validity

    4. Testing Numeric Equality

    5. Rounding Floating-Point Numbers

    6. Formatting Numbers for Text Display

    7. Converting Between Decimal and Hexadecimal Numbers

    8. Generating Pseudorandom Numbers

    9. Calculating Trigonometric Functions

    10. Creating a Date Object

    11. Calculating a Previous or Future Date

    12. Calculating the Number of Days Between Two Dates

    13. Validating a Date

  3. Chapter 3 Arrays and Objects

    1. Introduction

    2. Creating a Simple Array

    3. Creating a Multidimensional Array

    4. Converting Between Arrays and Strings

    5. Doing Something with the Items in an Array

    6. Sorting a Simple Array

    7. Combining Arrays

    8. Dividing Arrays

    9. Creating a Custom Object

    10. Simulating a Hash Table for Fast Array Lookup

    11. Doing Something with a Property of an Object

    12. Sorting an Array of Objects

    13. Customizing an Object's Prototype

    14. Converting Arrays and Custom Objects to Strings

  4. Chapter 4 Variables, Functions, and Flow Control

    1. Introduction

    2. Creating a JavaScript Variable

    3. Creating a Named Function

    4. Nesting Named Functions

    5. Creating an Anonymous Function

    6. Delaying a Function Call

    7. Branching Execution Based on Conditions

    8. Handling Script Errors Gracefully

    9. Improving Script Performance

  5. Chapter 5 Browser Feature Detection

    1. Introduction

    2. Detecting the Browser Brand

    3. Detecting an Early Browser Version

    4. Detecting the Internet Explorer Version

    5. Detecting the Netscape Navigator Version

    6. Detecting the Client Operating System

    7. Detecting Object Support

    8. Detecting Object Property and Method Support

    9. Detecting the Browser Written Language

    10. Detecting Cookie Availability

    11. Defining Browser- or Feature-Specific Links

    12. Testing on Multiple Browser Versions

  6. Chapter 6 Managing Browser Windows

    1. Introduction

    2. Setting the Main Window's Size

    3. Positioning the Main Window

    4. Maximizing the Main Window

    5. Creating a New Window

    6. Bringing a Window to the Front

    7. Communicating with a New Window

    8. Communicating Back to the Main Window

    9. Using Internet Explorer Modal/Modeless Windows

    10. Simulating a Cross-Browser Modal Dialog Window

    11. Simulating a Window with Layers

  7. Chapter 7 Managing Multiple Frames

    1. Introduction

    2. Creating a Blank Frame in a New Frameset

    3. Changing the Content of One Frame from Another

    4. Changing the Content of Multiple Frames at Once

    5. Replacing a Frameset with a Single Page

    6. Avoiding Being "Framed" by Another Site

    7. Assuring a Page Loads in its Frameset

    8. Reading a Frame's Dimensions

    9. Resizing Frames

    10. Setting Frameset Specifications Dynamically

  8. Chapter 8 Dynamic Forms

    1. Introduction

    2. Auto-Focusing the First Text Field

    3. Performing Common Text Field Validations

    4. Preventing Form Submission upon Validation Failure

    5. Auto-Focusing an Invalid Text Field Entry

    6. Changing a Form's Action

    7. Blocking Submissions from the Enter Key

    8. Advancing Text Field Focus with the Enter Key

    9. Submitting a Form by an Enter Key Press in Any Text Box

    10. Disabling Form Controls

    11. Hiding and Showing Form Controls

    12. Allowing Only Numbers (or Letters) in a Text Box

    13. Auto-Tabbing for Fixed-Length Text Boxes

    14. Changing select Element Content

    15. Copying Form Data Between Pages

  9. Chapter 9 Managing Events

    1. Introduction

    2. Equalizing the IE and W3C Event Models

    3. Initiating a Process After the Page Loads

    4. Determining the Coordinates of a Click Event

    5. Preventing an Event from Performing Its Default Behavior

    6. Blocking Double Clicks

    7. Determining Which Element Received an Event

    8. Determining Which Mouse Button Was Pressed

    9. Reading Which Character Key Was Typed

    10. Reading Which Noncharacter Key Was Pressed

    11. Determining Which Modifier Keys Were Pressed During an Event

    12. Determining the Element the Cursor Rolled From/To

    13. Synchronizing Sounds to Events

  10. Chapter 10 Page Navigation Techniques

    1. Introduction

    2. Loading a New Page or Anchor

    3. Keeping a Page Out of the Browser History

    4. Using a select Element for Navigation

    5. Passing Data Between Pages Via Cookies

    6. Passing Data Between Pages Via Frames

    7. Passing Data Between Pages Via URLs

    8. Creating a Contextual (Right-Click) Menu

    9. Creating Drop-Down Navigation Menus

    10. Providing Navigation Trail Menus

    11. Creating Expandable Menus

    12. Creating Collapsible XML Menus

  11. Chapter 11 Managing Style Sheets

    1. Introduction

    2. Assigning Style Sheet Rules to an Element Globally

    3. Assigning Style Sheet Rules to a Subgroup of Elements

    4. Assigning Style Sheet Rules to an Individual Element

    5. Importing External Style Sheets

    6. Importing Browser- or Operating System-Specific Style Sheets

    7. Changing Imported Style Sheets After Loading

    8. Enabling/Disabling Style Sheets

    9. Toggling Between Style Sheets for an Element

    10. Overriding a Style Sheet Rule

    11. Turning Arbitrary Content into a Styled Element

    12. Creating Center-Aligned Body Elements

    13. Reading Effective Style Sheet Property Values

    14. Forcing Version 6 Browsers into Standards-Compatibility Mode

  12. Chapter 12 Visual Effects for Stationary Content

    1. Introduction

    2. Precaching Images

    3. Swapping Images (Rollovers)

    4. Changing Text Style Properties

    5. Offering Body Text Size Choices to Users

    6. Creating Custom Link Styles

    7. Changing Page Background Colors and Images

    8. Hiding and Showing Elements

    9. Adjusting Element Transparency

    10. Creating Transition Visual Effects

  13. Chapter 13 Positioning HTML Elements

    1. Introduction

    2. Making an Element Positionable in the Document Space

    3. Connecting a Positioned Element to a Body Element

    4. Controlling Positioning Via a DHTML JavaScript Library

    5. Deciding Between div and span Containers

    6. Adjusting Positioned Element Stacking Order (z-order)

    7. Centering an Element on Top of Another Element

    8. Centering an Element in a Window or Frame

    9. Determining the Location of a Nonpositioned Element

    10. Animating Straight-Line Element Paths

    11. Animating Circular Element Paths

    12. Creating a Draggable Element

    13. Scrolling div Content

    14. Creating a Custom Scrollbar

  14. Chapter 14 Creating Dynamic Content

    1. Introduction

    2. Writing Dynamic Content During Page Loading

    3. Creating New Page Content Dynamically

    4. Including External HTML Content

    5. Embedding XML Data

    6. Embedding Data as JavaScript Objects

    7. Transforming XML Data into HTML Tables

    8. Transforming JavaScript Objects into HTML Tables

    9. Converting an XML Node Tree to JavaScript Objects

    10. Creating a New Element

    11. Creating Text Content for a New Element

    12. Creating Mixed Element and Text Nodes

    13. Inserting and Populating an iframe Element

    14. Getting a Reference to an HTML Element Object

    15. Replacing Portions of Body Content

    16. Removing Body Content

    17. Sorting Dynamic Tables

    18. Walking the Document Node Tree

    19. Capturing Document Content

  15. Chapter 15 Dynamic Content Applications

    1. Introduction

    2. Displaying a Random Aphorism

    3. Converting a User Selection into an Arbitrary Element

    4. Automating the Search-and-Replace of Body Content

    5. Creating a Slide Show

    6. Auto-Scrolling the Page

    7. Greeting Users with Their Time of Day

    8. Displaying the Number of Days Before Christmas

    9. Displaying a Countdown Timer

    10. Creating a Calendar Date Picker

    11. Displaying an Animated Progress Bar

  1. Appendix A Keyboard Event Character Values

  2. Appendix B Keyboard Key Code Values

  3. Appendix C ECMAScript Reserved Keywords

  4. Colophon